Sunday 9 December 2018

DTEXEC command to execute the SSIS package

The DTEXEC command prompt utility is used to configure and execute SQL Server Integration Services packages. The DTEXEC utility provides access to the entire package configuration and execution features, such as parameters, connections, properties, variables, logging, and progress indicators. The DTEXEC utility lets you load packages from these sources: the Integration Services server, an .ispac project file, a Microsoft SQL Server database, the SSIS Package Store, and the file system.
Let’s see the example:
I am creating a simple package which is use to insert record from a table.


  In package I am taking execute SQL task and running this package.
 
 

See the records in database.
 
  
Get expected result.
Now I am deploying this package in file system.
Before running the package truncating the table.
 
 

DTEXEC.exe runs in command prompt.
Now opening the command prompt
We need to go to BINN directory
c:\Program Files\Microsoft SQL Server\110\DTS\Binn
  
Here we will get the DTEXEC.exe see below
  
Now we need to run package my package is in below path
I:\SSIS1\Test_08_12_2018\Test_08_12_2018
  
Typing the command
/FILE "I:\SSIS1\Test_08_12_2018\Test_08_12_2018\Package.dtsx"
 
Press enter

Package executed successfully.
See the records in database.
  
After executing it will return below code.
 

Value
Description
0
The package executed successfully.
1
The package failed.
3
The package was cancelled by the user.
4
The utility was unable to locate the requested package. The package could not be found.
5
The utility was unable to load the requested package. The package could not be loaded.
6
The utility encountered an internal error of syntactic or semantic errors in the command line.


No comments:

Post a Comment

If you have any doubt, please let me know.

Popular Posts