Wednesday, 27 February 2019

Executing SSIS package from batch file

We can also execute the SSIS package through a batch file.
In this article, we will see how we can execute the package through a batch file.
I am creating a simple package. This package I so simple, in this package I am inserting a record into a table.
                  
Inserting a table into this package
  
Now I am running this package

Package executed successfully.
See the record into the table
  
Now I am creating a batch file which call the package.
In the batch file we are calling DTEXEC.exe to execute the package.

Read: DTEXEC command to execute the SSIS package

In the text file I am writing below code
@ECHO OFF
CLS
ECHO My Test Package executing from batch file
PAUSE
"c:\Program Files\Microsoft SQL Server\110\DTS\Binn\DTEXEC.exe" /File "H:\Package.dtsx"
PAUSE
Save it with .bat extension.
 
 

File is created.
  

Now click on the bat file
Before running this package record in the database table
  

Now running the batch file
  

File executed successfully.
See the records into the database table.
 


2 comments:

  1. What version of Visual Studio and Management studio is required for this batch scheduling? I am getting a version error.

    ReplyDelete

If you have any doubt, please let me know.

Popular Posts