-->

Is it possible to pass parameters to a .dtsx packa

2020-07-09 07:21发布

问题:

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?

回答1:

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

  • dtexec Utility (SSIS Tool)
  • DTEXEC package with multiple parameters