SSIS - How To Execute Batch File By Using SSIS Package

Scenario:

We have created a batch file that copies all the files from Source folder to Destination folder. We want to execute this batch file in SQL Server Integration Services (SSIS) Package.

Solution:

To execute batch file from SQL Server Integration Services Package, we will be using Execute Process Task from Control Flow Items.

Step 1: 
Drag Execute Process Task to Control Flow Pane. Double click or Edit it by right click
Locate the path for your Executable, In my case the CMD.exe is present on C:\Windows\System32\cmd.exe.
In Argument , provide the path of your batch file as given below
/c C:\Users\ashahzad\Desktop\Mybatch.bat

Note:
 You can create variables to save paths for Executable and Arguments so on different machines you can change those values by using SSIS Configuration.

Final Step: 
After executing our SSIS Package, we can see that the batch file was executed successfully by SSIS Package and files were copiedd from Source to Destination Folder.


2 comments:

  1. The first thing to look at when trying to decide if a new copy machine is right for your business is, well, your business. photostat machine

    ReplyDelete
  2. Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. Vacuum casting parts

    ReplyDelete