![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Is there a way to do the following in a dts package? Using the pubs db - INSERT INTO db1.dbo.authors (au_id, au_fname, au_lname, city, state, zip, phone, contract) SELECT au_id, @FIRSTNAME, @LASTNAME, city, state, zip, phone, contract) FROM db2.dbo.authors Where @FIRSTNAME and @LASTNAME are global variables that I can call in additional tasks? The values are static, and I have just been declaring them in each of my tasks, but That means I need to update this static value in each task when we go live. I'd like to make it global so I only have to change it once. Basically, I'm migrating a ton of data from one system to another, and the destination system has 6 static fields that are in EVERY table. So, I have to declare these for EVERY Insert. |
#4
| |||
| |||
|
#5
| |||
| |||
|
#6
| |||
| |||
|
#7
| |||
| |||
|
#8
| |||
| |||
|
|
How about showing us the exact SQL code? -- Tom ---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinpub.com .. "Sharon McMillon" <smcmillon (AT) gmail (DOT) com> wrote in message news:1124406903.576849.159240 (AT) z14g2000cwz (DOT) googlegroups.com... whoops - sorry - when I use it in the SELECT, I get a syntax error. |
#9
| |||
| |||
|
|
If the table name is going to be dynamice, you cannot pass a variable into the from statement. To do this, unfortunately you have to use dynamic SQL. "Tom Moreau" wrote: How about showing us the exact SQL code? -- Tom ---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinpub.com .. "Sharon McMillon" <smcmillon (AT) gmail (DOT) com> wrote in message news:1124406903.576849.159240 (AT) z14g2000cwz (DOT) googlegroups.com... whoops - sorry - when I use it in the SELECT, I get a syntax error. |
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |