Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Passing a variable to a DTS Package from SPROC

Guest
Sep 21, 2008 Sep 21, 2008
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!!!
TOPICS
Database access
422
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 21, 2008 Sep 21, 2008
See attached code for an example.
Ken
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 22, 2008 Sep 22, 2008
Ken,

Thank you very much for replying. Do you think the problem is with my dtsrun statement in my stored procedure or in the actual package that is trying to query the table?

Thanks again!!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 22, 2008 Sep 22, 2008
LATEST
As I don't know what is in your dtsrun or the package, what can I say about them ?

You should be able to use the stored procedure code I supplied, just changing the values to suit your package.

Ken
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources