Run the SSIS package using dtexec from xp_cmdshell

Source: Internet
Author: User
Tags ssis

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.