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
?
Your code samples above are not clear. Basically, you can't pass parameters to a package. A package is just a wrapper around a set of functions, which you can call after the package has been imported. You can pass parameter values to the functions, but they must be the correct type as the function requires.
Open the package in SQL Server Data Tools, and then click the Parameters tab in the SSIS Designer. Click the Add Parameter button on the toolbar. Enter values for the Name, Data Type, Value, Sensitive, and Required properties in the list itself or in the Properties window.
The dtexec command prompt utility is used to configure and execute SQL Server Integration Services packages. The dtexec utility provides access to all the package configuration and execution features, such as parameters, connections, properties, variables, logging, and progress indicators.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With