Saturday 12 September 2020

Execute windows bat file from SSIS

We have a windows .bat file and we need to execute this .bat file.

We will see how to execute the bat file in SSIS.

For demo we are creating a .bat to copy the files from the source to the destination folder. We have a source folder which is having n number of files and we need to copy it into the destination.

      

We need to copy all files into the Destination.

         


Below is the .bat file to copy the files from source to destination.

copy "I:\ssis_example\Source\*.*" "I:\ssis_example\Destination"

 


 Save it with .bat file extension.

The batch file is ready to run. We can test it here.

See the destination folder.

   

Click on the .bat file a command prompt will be open

   

See the destination folder    

Files copy successfully.

Now we are calling this .bat file in SSIS package.

Read More about: Execute Process Task:

https://bageshkumarbagi-msbi.blogspot.com/2014/12/execute-process-task.html

Taking Execute process task 

Double click on this task.

We need to provide the full path of the bat file on Executable

Click ok.

                            

It is ready to run.

See the destination folder.

Now running this package.

Package executing….

Executed successfully.

See the execution progress


Now see the destination folder.

This is a simple demo to call the .bat file in SSIS package. We can write the .bat file based on our business requirement.

1 comment:

If you have any doubt, please let me know.

Popular Posts