dbTalk Databases Forums  

DTS variables

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


Discuss DTS variables in the microsoft.public.sqlserver.dts forum.



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

Default DTS variables - 01-18-2005 , 02:25 PM






Hi,
Using SQL server 2000 on Windows server 20003.

I need to copy table(s) from one database to another. I have created a Copy
SQL Server Objects Task to do this. However, I need to have a user run this
from Access VBA. I would like to have them input a table name, press a
button and the table copies.

How can I pass a table name as a variable to this task. I have gotten as far
as 'LoadfromSQLServer' etc, but I can't do the rest.

Thanks for any help.



Reply With Quote
  #2  
Old   
Ed
 
Posts: n/a

Default RE: DTS variables - 01-19-2005 , 11:21 AM






What I would suggest you to do is to create a globle variable in the package
and create a dynamic properties task and have the destination connection
based on that Properties task. In the VBA code add something like

Set pkg = CreateObject("DTS.Package")
Set pkg = LoadfromSQLServer....
pkg.GlobalVariables("YourGlobalVariablesInThePacka ge") =
InputFromUserInTheForm
pkg.execute

it is not too hard, but tough to explain...

Ed

"Tom Swanick" wrote:

Quote:
Hi,
Using SQL server 2000 on Windows server 20003.

I need to copy table(s) from one database to another. I have created a Copy
SQL Server Objects Task to do this. However, I need to have a user run this
from Access VBA. I would like to have them input a table name, press a
button and the table copies.

How can I pass a table name as a variable to this task. I have gotten as far
as 'LoadfromSQLServer' etc, but I can't do the rest.

Thanks for any help.




Reply With Quote
  #3  
Old   
Tom Swanick
 
Posts: n/a

Default Re: DTS variables - 01-21-2005 , 04:45 AM



Thanks ED,

I'll try it.

"Ed" <Ed (AT) discussions (DOT) microsoft.com> a écrit dans le message de
news:EE109E9A-D312-43F6-8951-B7EA97C2A487 (AT) microsoft (DOT) com...
Quote:
What I would suggest you to do is to create a globle variable in the
package
and create a dynamic properties task and have the destination connection
based on that Properties task. In the VBA code add something like

Set pkg = CreateObject("DTS.Package")
Set pkg = LoadfromSQLServer....
pkg.GlobalVariables("YourGlobalVariablesInThePacka ge") =
InputFromUserInTheForm
pkg.execute

it is not too hard, but tough to explain...

Ed

"Tom Swanick" wrote:

Hi,
Using SQL server 2000 on Windows server 20003.

I need to copy table(s) from one database to another. I have created a
Copy
SQL Server Objects Task to do this. However, I need to have a user run
this
from Access VBA. I would like to have them input a table name, press a
button and the table copies.

How can I pass a table name as a variable to this task. I have gotten as
far
as 'LoadfromSQLServer' etc, but I can't do the rest.

Thanks for any help.






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.