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

痞子三分冷 提交于 2019-12-06 05:39:31

问题


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


来源:https://stackoverflow.com/questions/48511517/is-it-possible-to-pass-parameters-to-a-dtsx-package-on-the-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!