Groups | Blog | Home
all groups > sql server dts > december 2005 >

sql server dts : replacing a char data type with numeric in numerous DTS packages


Munch
12/29/2005 10:54:03 AM
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?

Allan Mitchell
1/3/2006 2:17:34 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



[quoted text, click to view]

AddThis Social Bookmark Button