Run the SSIS package using dtexec from xp_cmdshell
Use dtexec from xp_cmdshell
You can run dtexec from The xp_cmdshell prompt. The following example shows how to run the package named upsertdata. dtsx and ignore the returnedCode:
Exec xp_cmdshell 'dtexec/F "C: \ upsertdata. dtsx "'
The following example shows how to run the same package and capture the return code:
Declare @ returncode int
Exec @ returncode = xp_mongoshell 'dtexec/F "C: \ upsertdata. dtsx "'
to use Windows authentication to run the SSIS package saved to SQL Server, use the following code:
dtexec/SQ pkgone/SER productionserver
to run the SSIS package in the file system folder in the SSIS package storage area, use the following code:
dtexec/DTS "\ File System \ mypackage"
to authenticate a package that uses Windows Authentication and is saved in SQL Server but does not execute this package, use the following code:
dtexec/SQ pkgone/SER productionserver/VA
to run the SSIS package stored in the file system, use the following code:
dtexec/F "C: \ pkgone. dtsx "
to run the SSIS package stored in the file system and specify the log options, run the following code:
DTE Xec/F "C: \ pkgone. dtsx "/L" DTs. logprovidertextfile; C: \ log.txt "
to perform Windows Authentication and save the package to the default local instance of SQL Server, and view its version before execution, use the following code:
dtexec/SQ pkgone/verifyv {c200e360-38c5-11c5-11ce-ae62-08002b2b79ef}
to execute an SSIS package that is saved in a file system and externally configured, use the following code:
dtexec/F "C: \ pkgone. dtsx "/conf" C: \ pkgoneconfig. cfg "
Note:
If the path or file name contains spaces, the package_path or filespec parameters of the/SQL,/DTS, or/file options must be enclosed by quotation marks. If no quotation marks are used, the parameter cannot contain spaces.