Running Packages
To execute an SSIS package saved to SQL Server using Windows authentication, use the following code:
dtexec /sq pkgOne /ser productionServer
To execute an SSIS package saved to the File System folder in the SSIS Package Store, use the following code:
dtexec /dts "\File System\MyPackage"
To validate a package that uses Windows Authentication and is saved in SQL Server without executing the package, use the following code:
dtexec /sq pkgOne /ser productionServer /va
To execute an SSIS package that is saved in the file system, use the following code:
dtexec /f "c:\pkgOne.dtsx"
To execute an SSIS package that is saved in the file system, and specify logging options, use the following code:
dtexec /f "c:\pkgOne.dtsx" /l "DTS.LogProviderTextFile;c:\log.txt"
To execute a package that uses Windows Authentication and is saved to the default local instance of SQL Server, and verify the version before it is executed, use the following code:
dtexec /sq pkgOne /verifyv {c200e360-38c5-11c5-11ce-ae62-08002b2b79ef} To execute an SSIS package that is saved in the file system and configured externally, use the following code:
dtexec /f "c:\pkgOne.dtsx" /conf "c:\pkgOneConfig.cfg"
Note: |
|---|
|
The package_path or filespec arguments of the /SQL, /DTS, or /FILE options must be enclosed in quotation marks if the path or file name contains a space. If the argument is not enclosed in quotation marks, the argument cannot contain white space. |
Logging Option
If there are three log entry types of A, B, and C, the following ConsoleLog option without a parameter displays all three log types with all fields:
The following option displays all log types, but with the Name and Message columns only:
The following option displays all columns, but only for log entry type A:
/CONSOLELOG I;LogEntryTypeA
The following option displays only log entry type A, with Name and Message columns:
/CONSOLELOG NM;I;LogEntryTypeA
The following option displays log entries for log entry types A and B:
/CONSOLELOG I;LogEntryTypeA;LogEntryTypeB
You can achieve the same results by using multiple ConsoleLog options:
/CONSOLELOG I;LogEntryTypeA /CONSOLELOG I;LogEntryTypeB
If the ConsoleLog option is used without parameters, all fields are displayed. The inclusion of a list_options parameter causes the following to displays only log entry type A, with all fields:
/CONSOLELOG NM;I;LogEntryTypeA /CONSOLELOG
The following displays all log entries except log entry type A: that is, it displays log entry types B and C:
/CONSOLELOG E;LogEntryTypeA
The following example achieves the same results by using multiple ConsoleLog options and a single exclusion:
/CONSOLELOG E;LogEntryTypeA /CONSOLELOG
/CONSOLELOG E;LogEntryTypeA /CONSOLELOG E;LogEntryTypeA
/CONSOLELOG E;LogEntryTypeA;LogEntryTypeA
The following example displays no log messages, because when a log file type is found in both the included and excluded lists, it will be excluded.
/CONSOLELOG E;LogEntryTypeA /CONSOLELOG I;LogEntryTypeA
SET Option
The following shows how to use the /SET option, which lets you change the value of any package property or variable when you start the package from the command line.
/SET \package\DataFlowTask.Variables[User::MyVariable].Value;newValue