dbTalk Databases Forums  

setting DTS Global Variables

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


Discuss setting DTS Global Variables in the microsoft.public.sqlserver.dts forum.



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

Default setting DTS Global Variables - 10-26-2005 , 12:26 PM






I have a Text File which I Import through a DTS package

That is all fine and dandy, but what I would like to do is set the
destination of the file to a different server through code. So if I specify
server X and database XX in code then the dts will dump the file there, if i
specify server X (same server) and database YY (different database) it will
dump the table there. Any ideas on how to do this?

I have something that I created, where I have some code with two variables
(server and database). In the DTS steps I execute that the first. Then once
I set those variables, the second thing to execute is a dynamic properties
task which takes the Server name and database name in the connection from
its previous task (so from my variables). Then I have the actual
tranformation which happens. But the thing is even though the server and
database are properly changed in the SQL server, the transformation doesn't
change, therefore it's still executing against the previous database (not
against the one I defined in the variable)

Any ideas? thanks

Leo



Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: setting DTS Global Variables - 10-26-2005 , 01:50 PM






Leo wrote:
Quote:
I have a Text File which I Import through a DTS package

That is all fine and dandy, but what I would like to do is set the
destination of the file to a different server through code. So if I specify
server X and database XX in code then the dts will dump the file there, if i
specify server X (same server) and database YY (different database) it will
dump the table there. Any ideas on how to do this?

I have something that I created, where I have some code with two variables
(server and database). In the DTS steps I execute that the first. Then once
I set those variables, the second thing to execute is a dynamic properties
task which takes the Server name and database name in the connection from
its previous task (so from my variables). Then I have the actual
tranformation which happens. But the thing is even though the server and
database are properly changed in the SQL server, the transformation doesn't
change, therefore it's still executing against the previous database (not
against the one I defined in the variable)

Any ideas? thanks

Leo


Changing the DataPump Source and Destination Tables
(http://www.sqldts.com/default.aspx?213)

--
Darren Green
http://www.sqldts.com
http://www.sqlis.com


Reply With Quote
  #3  
Old   
Leo
 
Posts: n/a

Default Re: setting DTS Global Variables - 10-27-2005 , 10:35 AM



thanks for the reply darren
I would like to execute the DTS from the command line, that is use DTSRUN

I have something like this

dtsrun /SDC00675 /Usa /Ppwd3456 /NpkgImportText /ADatabaseName=Northwind3

so my global variable name is DatabaseName

now I want to change it to

dtsrun /SDC00675 /Usa /Ppwd3456 /NpkgImportText /ADatabaseName=Northwind2


but it's not working. I do not want to change the database object names
(since they will be the same) only the database names (within the same
server)





"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
Leo wrote:
I have a Text File which I Import through a DTS package

That is all fine and dandy, but what I would like to do is set the
destination of the file to a different server through code. So if I
specify
server X and database XX in code then the dts will dump the file there,
if i
specify server X (same server) and database YY (different database) it
will
dump the table there. Any ideas on how to do this?

I have something that I created, where I have some code with two
variables
(server and database). In the DTS steps I execute that the first. Then
once
I set those variables, the second thing to execute is a dynamic
properties
task which takes the Server name and database name in the connection
from
its previous task (so from my variables). Then I have the actual
tranformation which happens. But the thing is even though the server and
database are properly changed in the SQL server, the transformation
doesn't
change, therefore it's still executing against the previous database
(not
against the one I defined in the variable)

Any ideas? thanks

Leo


Changing the DataPump Source and Destination Tables
(http://www.sqldts.com/default.aspx?213)

--
Darren Green
http://www.sqldts.com
http://www.sqlis.com



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.