Tuesday, March 09, 2010

SSIS 2005: Calling a package execution from the command line with variables

In order to call a package execution from the command line, SSIS has the 'dtexec' utility.

For more information check the URL from Microsoft:

http://msdn.microsoft.com/en-us/library/ms162810.aspx

another good link is this one:

http://www.mssqltips.com/tip.asp?tip=1812

The idea is to call a package execution from the command line in order to speed up testing.

The simple expression is to call the file directly:

dtexec /F 'file path'

to use variables the expression adds the following:

/SET \Package.Variables[User::'VariableName'].Properties[Value];'NewValue'


or, if the variable is a task value:

/SET \package\'DataFlowTask'.Variables[User::'VariableName'].Value;'NewValue'

It works very well.

For my next challenge I need to send the result to a file in order to check how everything worked.

Regards,

No comments: