August 16, 2009 at 9:28 pm
OH! Great SQL minds,
I am NEW to SSIS (2005) I need to re-create a SQL 7.0 DTS.
The DTS contains a Process Task that runs a batch file, which requires command-line args. These args must be determined by a previous Script Task that reads data from several files.
How can these runtime-generated args be passed/asigned to the Process Task that will use them once the script task completes.
Thank you so much for your guidance.
Alex.
P.D. The DTS Migration tool is not that smart.
August 17, 2009 at 6:34 am
Hello,
Variables are your friend. Assign the command line args to one or many variables(depending on circumstances) in the script task.
To run the batch file, you can use a execute sql task that runs xp_cmdshell. Create another variable called SQLCommand (or whatever 🙂 ) and set this variable's EvaluateAsExpression property as True. In the Expression property you insert the syntax to build the SQL statement from your variable containing the arguments.
In the Execute SQL Task you change the SQLSourceType property to "Variable". You then select your SQLCommand variable from the drop down list supplied in the SourceVariable property.
Hope this helps.
Cheers
----------------------------------------------------------------------------------------------
Struggling to find the question?
http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
August 17, 2009 at 10:27 am
Thank you for your kind assistance.
I'll look into it as soon as I get ot the office.
Have a good day.
Alex.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply