dbTalk Databases Forums  

replacing a char data type with numeric in numerous DTS packages

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


Discuss replacing a char data type with numeric in numerous DTS packages in the microsoft.public.sqlserver.dts forum.



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

Default replacing a char data type with numeric in numerous DTS packages - 12-29-2005 , 12:54 PM






I have a table structure that is being used in a number of packages in a
create statment. I just noticed that one of the fields should be a numeric
type in stead of a char, is there a way to run a search and replace on the
Create statement either within a DTS package or through a sp or other admin
function?

Thanks

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

Default Re: replacing a char data type with numeric in numerous DTS packages - 01-03-2006 , 04:17 PM






Hello Munch,

Sure you can. I presume the statement in question is in an ExecuteSQL task
or three.

What you will need to do is this


Loop over the packages

Enumerating DTS Packages using VB.Net
(http://www.sqldts.com/default.aspx?250)

Open the packages in code

Loop through the package's Tasks collection

Ensure it is an ExecuteSQL task (CustomTaskID == DTSExecuteSQLTask)

Read the SQLStatement property

Change it

Save the Package back using code


Allan



Quote:
I have a table structure that is being used in a number of packages in
a create statment. I just noticed that one of the fields should be a
numeric type in stead of a char, is there a way to run a search and
replace on the Create statement either within a DTS package or through
a sp or other admin function?

Thanks




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.