SolvedPrivate

Running an SSIS package from a bat file

Posted on 2014-04-07
5
48 Views
Last Modified: 2016-02-10
Hi,
I can run an SSIS package from the command prompt using the following command;
c:\Program Files\Microsoft SQL Server\100\DTS\Binn>dtexec.exe /f c:\batch\writeSuccesWhenPackageFails.dtsx

Open in new window

I now need to call this package from a batch file.
What is the syntax I need to put in the batch file?
Any guidance appreciated
Thanks
0
Comment
Question by:blossompark
  • 2
  • 2
5 Comments
 
LVL 25

Assisted Solution

by:Lee Savidge
Lee Savidge earned 250 total points
ID: 39982806
Well, there is no reason why you can't just put that line in a batch file like this but you need to take into account the spaces in the folder names:

@echo off
cd c:\Program Files\Microsoft SQL Server\100\DTS\Binn
dtexec.exe /f c:\batch\writeSuccesWhenPackageFails.dtsx

Open in new window

0
 
LVL 54

Accepted Solution

by:
Bill Prew earned 250 total points
ID: 39982810
You can use basically the same syntax in a BAT file, although you will need to quote the program name since it has spaces.  So a simple BAT like this would run it:

@echo off
"c:\Program Files\Microsoft SQL Server\100\DTS\Binn>dtexec.exe" /f c:\batch\writeSuccesWhenPackageFails.dtsx

Open in new window

Depending on what you want to happen to the BAT file while the SSIS runs you can also use the START command, but no need to go into that added complexity if it isn't needed.

Try a BAT file as mentioned above and see how it goes.

~bp
0
 

Author Closing Comment

by:blossompark
ID: 39982839
Hi Lee and Bill,
Thanks for your comments

Below worked perfectly.
@echo off

"c:\Program Files\Microsoft SQL Server\100\DTS\Binn\dtexec.exe" /FILE "c:\batch\writeSuccesWhenPackageFails.dtsx"

PAUSE
0
 
LVL 54

Expert Comment

by:Bill Prew
ID: 39982852
Welcome, glad we were able to help.

~bp
0
 
LVL 25

Expert Comment

by:Lee Savidge
ID: 39982855
Glad to help :)
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question