Is it possible to pass parameters to a .dtsx package on the command line?

Hoppy picture Hoppy · Jan 30, 2018 · Viewed 10k times · Source

I am currently executing an SSIS package (package.dtsx) from the command line using Dtexec. This is as simple as:

dtexec /f Package.dtsx

However, I have some parameters that I would like to pass to the package for it to use during execution. The documentation implies that this might be possible (i.e. the /Par parameter), but it is not clear. Is it possible to pass parameters to a .DTSX file using dtexec?

Answer

Hadi picture Hadi · Jan 30, 2018

Of course yes, you can assign values to variables using dtexec

Syntax

dtexec /f mypackage.dtsx /set \package.variables[myvariable].Value;myvalue

Example

dtexec.exe /FILE "D:\TestPkg.dtsx" 
/SET \Package.Variables[User::Name].Properties[Value];"LOAD_DAILY" 
/SET \Package.Variables[User::File].Properties[Value];"D:\Load Test.txt" 
/SET \Package.Variables[User::Count].Properties[Value];5

References