all groups > sql server dts > february 2006 >
You're in the

sql server dts

group:

Update transformations after changing target database


Update transformations after changing target database jada
2/14/2006 11:11:07 PM
sql server dts:
Hi all,

I have this problem where I have to frequently change the target
database of my transform data tasks. I've already figured out how to
change the destination tablename through ActiveX script, but I don't
know how I can drop all existing transformations and recreate them
(since they remember old values and don't work) in the same script.
Each of the transformations merely maps a source column to a
destination column. Here are my questions:

1) I've read somewhere that I actually don't need to recreate the
transformations. All I need to do is to dynamically change the source
table as well. Is this correct?

2) If I do have to recreate the transformations one by one, how can I
create them? Do I have to specify all of the properties? Or do I just
do something like DTSDestination("Role") = DTSSource("Role")?

3) What I have currently is I first copy all existing transformations
to an array, delete all existing transformations, then all each of the
transformations in the array back. However, this doesn't work. Does
it have to get this complicated?

All thoughts and comments are helpful!

Thanks for your time in advance.

Regards,

Jada
Re: Update transformations after changing target database Allan Mitchell
2/19/2006 8:45:04 AM
Hello jada,


1. If the definitions of the transforms change then this is not true. DTS
has no autoremap. So say your transform looks like

Col1 --> Col1

But now you change the source and the destination and it should now look like

Col2 --> Col2


This will not get remapped.

If you mail me privately I can send you an example of how to do this



Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

[quoted text, click to view]

AddThis Social Bookmark Button