Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Import variables into DTS Package

Author  Topic 

sdettling
Starting Member

2 Posts

Posted - 2008-09-21 : 11:09:38
Hello all,

I am trying to pass a variable from a stored procedure into a dts package. In the dtsrun command (within the stored procedure), I have added the following:

/A batchID:varchar(50)=@messageBatchKey

In the package I added batchID into the global variables tab and set it as a sting. What I need to do is perform a data transfer based on the batchid that I pass in.

Here is what I am doing in the Transform Data Task query section:

SELECT t_sqlbox_outbox_sms.*
FROM t_sqlbox_outbox_sms
WHERE t_sqlbox_outbox_sms.message_log_id = '" & _DTSGlobalVariables("@batchID").Value & "'

Nothing seems to be working though. Can someone help??

Thanks!!!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-21 : 13:10:54
quote:
Originally posted by sdettling

Hello all,

I am trying to pass a variable from a stored procedure into a dts package. In the dtsrun command (within the stored procedure), I have added the following:

/A batchID:varchar(50)=@messageBatchKey

In the package I added batchID into the global variables tab and set it as a sting. What I need to do is perform a data transfer based on the batchid that I pass in.

Here is what I am doing in the Transform Data Task query section:

SELECT t_sqlbox_outbox_sms.*
FROM t_sqlbox_outbox_sms
WHERE t_sqlbox_outbox_sms.message_log_id = '" & _DTSGlobalVariables("@batchID").Value & "'

Nothing seems to be working though. Can someone help??

Thanks!!!


cant you use place holder (?) in transform data task query pane and then use activex script for lookup?

http://www.databasejournal.com/features/mssql/article.php/10894_3300201
Go to Top of Page

sdettling
Starting Member

2 Posts

Posted - 2008-09-22 : 12:14:36
Thanks for replying. I thought I tried that but it did not work. Could you tell me exactly where I would enter this?? Also, is the dtsrun command correct (/A batchID:varchar(50)=@messageBatchKey)??

Thank you very much for your help.
Go to Top of Page
   

- Advertisement -