dbTalk Databases Forums  

Searching for Strings in DTS packages

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Searching for Strings in DTS packages in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
BEN
 
Posts: n/a

Default Searching for Strings in DTS packages - 10-18-2004 , 04:49 PM






I have a large library of DTS packages (as *.dts files) in
a folder.

I'm trying to determine which of the "n" files in the
folder reference a line of ActiveX code or variable.

Clearly, I cant do a search thru Windows as the DTS
packages are encrypted. But, does Enterprise Manager have
some utility which could do this search? Otherwise, I
need to open "n" files with "m" ActiveX scripts and it
will take forever (m*n > moreTimeThanIhave).




Reply With Quote
  #2  
Old   
cbDevelopment
 
Posts: n/a

Default Re: Searching for Strings in DTS packages - 10-18-2004 , 09:11 PM






This VB Script might help you. Sorry, I couldn't take the time to dive
into the transformations and search the ActiveX Transforms, but hopefully
this will find all the instances in your ActiveX tasks.

Copy this into a .vbs file saved in the same directory as your dts files.
Run from a command prompt like:

wscript [GivenFileName] [search string]

or doubleclick in windows Explorer.

Best of luck!


' Script to search ActiveXTasks for a given string
set fso=createobject("scripting.filesystemobject")
set rootfolder=fso.getfolder(".")

if wscript.arguments.count>0 then
FindString=wscript.arguments(0)
else
findstring=inputbox("Enter the word to find in all DTS packages")
end if

for each f in rootfolder.files
set d=createobject("dts.package")

if lcase(right(f.name,4))=".dts" then
d.LoadFromStorageFile f.name, ""
For Each t In d.Tasks
If t.CustomTaskID = "DTSActiveScriptTask" Then
scr=t.CustomTask.Properties.Item("ActiveXScript"). Value
if instr(lcase(scr),lcase(findstring)) then
msg=msg & "File: " & f.name & vbcrlf
msg=msg & "Task: " & t.name & vbcrlf
msg=msg & vbcrlf
end if
End If
Next
end if
set d=nothing
next

msg="Search found:" & msg
wscript.echo msg


"BEN" <blair.nicolle (AT) gmo (DOT) com> wrote in news:16ed01c4b55c$4c209940
$a301280a (AT) phx (DOT) gbl:

Quote:
I have a large library of DTS packages (as *.dts files) in
a folder.

I'm trying to determine which of the "n" files in the
folder reference a line of ActiveX code or variable.

Clearly, I cant do a search thru Windows as the DTS
packages are encrypted. But, does Enterprise Manager have
some utility which could do this search? Otherwise, I
need to open "n" files with "m" ActiveX scripts and it
will take forever (m*n > moreTimeThanIhave).






Reply With Quote
  #3  
Old   
Carlos Alvarado
 
Posts: n/a

Default Re: Searching for Strings in DTS packages - 10-25-2004 , 09:11 AM




Hi Ben,

Please see my free source code at
http://www.planet-source-code.com/vb...txtCodeId=903&
lngWId=5

[]s
Carlos


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.