Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 423
Hoppy Avatar asked Jan 29 '18 23:01

Hoppy


People also ask

Can we pass parameter to package?

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.

How do I add parameters to SSIS package?

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.

Which SSIS help in specifying the command line parameters?

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.


1 Answers

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
like image 133
Hadi Avatar answered Sep 27 '22 18:09

Hadi