Running an SSIS package from a bat file

Posted on 2014-04-07
Last Modified: 2016-02-10
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
Question by:blossompark
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
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

LVL 55

Accepted Solution

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.


Author Closing Comment

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"

LVL 55

Expert Comment

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

LVL 25

Expert Comment

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

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
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 …
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

724 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