Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

executing a batch command through SSIS Job

Tags:

ssis

I need to execute an batch file through SSIS job. previously we used to do this in cmd prompt, is there any way that we can run batch file through ssis job

like image 679
0537 Avatar asked Mar 19 '12 13:03

0537


People also ask

How do I run a batch file from SSIS?

Solution: To execute batch file from SQL Server Integration Services Package, we will be using Execute Process Task from Control Flow Items. Locate the path for your Executable, In my case the CMD.exe is present on C:\Windows\System32\cmd.exe.

How do I run an EXE file in SSIS?

Use the Process page of the Execute Process Task Editor dialog box to configure the options that execute the process. These options include the executable to run, its location, command prompt arguments, and the variables that provide input and capture output.


2 Answers

Use an Execute Process Task in your Control Flow to do this.

  • Create a new package in SSIS
  • You will start with the Control Flow open
  • Drag an Execute Process Task from the Toolbox (if the Toolbox is not open, open it with Menu -> View -> Toolbox) to the Control Flow
  • You can set the batch file path in RightMouseButton on the Task -> Edit... -> Process -> Executable

For further instructions on SSIS go to e.g. Microsoft

like image 82
Ocaso Protal Avatar answered Sep 18 '22 21:09

Ocaso Protal


First of all, consider if you really need to execute a batch file. Maybe there is a built in way to achieve what you need. For example if you are just moving/renaming files then you can use the FileSystemTask

Otherwise, you can use the ExecuteProcessTask

  • This page shows all the options that can be configured for this task, i.e. the path to the batch file, arguments, etc.
  • This page shows how to set those properties.
like image 29
Robbie Avatar answered Sep 17 '22 21:09

Robbie