dbTalk Databases Forums  

Renaming DTS connnections via SQL

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


Discuss Renaming DTS connnections via SQL in the microsoft.public.sqlserver.dts forum.



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

Default Renaming DTS connnections via SQL - 04-22-2004 , 05:54 AM






I have numerous DTS's which import data from text files - there are around
30-40 text files sources.

I have named them all with all capitals and would like to change them to all
lowercase via an update statement in msdb, rather than doing them all one by
one.

Is this possible my running an update statement in the msdb database?



Why? Well...

The reason is that in all caps, more of the connection name is shopped off
in DTS designer.

i.e.

"MYFILE_SERVER2000_SALESOUTPUT" is displayed as "MYFILE_SER..."

whereas in lowercase I can see moe of the name

"myfile_server2000_salesoutput" is displayed as "myfile_server2000_sale..."



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Renaming DTS connnections via SQL - 04-22-2004 , 06:56 AM






OK

You can iterate through the Connections collection in each package, grab the
text file connections, grab their Name property and then
change it

Not dissimilar to

Function Main()

dim cn, cnTemp

for each cn in DTSGlobalVariables.Parent.Connections
if cn.ProviderID = "DTSFlatFile" then
cnTemp = cn.name
cn.name = LCase( cnTemp )
end if
Next



Main = DTSTaskExecResult_Success
End Function


--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Beema" <none (AT) supplied (DOT) com> wrote

Quote:
I have numerous DTS's which import data from text files - there are around
30-40 text files sources.

I have named them all with all capitals and would like to change them to
all
lowercase via an update statement in msdb, rather than doing them all one
by
one.

Is this possible my running an update statement in the msdb database?



Why? Well...

The reason is that in all caps, more of the connection name is shopped off
in DTS designer.

i.e.

"MYFILE_SERVER2000_SALESOUTPUT" is displayed as "MYFILE_SER..."

whereas in lowercase I can see moe of the name

"myfile_server2000_salesoutput" is displayed as
"myfile_server2000_sale..."





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.