Passing List of Tables

  • I have a requirement to move the data from a dynamically selected group of tables in DB1 to a similar set of tables in DB2.  This happens on a fairly regular basis, but the list of tables is subject to change with each transfer.  I have created a query that will produce the list of tables that need to be moved (data only, no schema). 

    Problem is this: How do I pass that result set to DTS and tell DTS to scroll through the list moving the data from each table listed in DB1 to the corresponding table in  DB2. 

    This should be easy, but I can't seem to figure it out.

    Big THANK YOU to anyone who can point me in the right direction.

  • How about using activex to move through the list and for each moving the data?

     



    Shamless self promotion - read my blog http://sirsql.net

  • That would be a great solution if I knew anything about scripting.

  • I feel your pain there.....

    How about creating a proc and using a cursor to pass in the tables that need to be updated and then updating the table based upon the cursor value?



    Shamless self promotion - read my blog http://sirsql.net

  • That would alos be a good solution.  Since I have a select statement that defines the tables I need to copy, I can pass the list to a table, temp table, sursor, etc. 

    I am mystified about how I get that result set into DTS so it can use it.

  • Why use a dts if you don't need to? Just run an insert as a part of the proc.



    Shamless self promotion - read my blog http://sirsql.net

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply