SolvedPrivate

Running an SSIS package from a bat file

Posted on 2014-04-07
5
44 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
Comment Utility
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 51

Accepted Solution

by:
Bill Prew earned 250 total points
Comment Utility
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
Comment Utility
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 51

Expert Comment

by:Bill Prew
Comment Utility
Welcome, glad we were able to help.

~bp
0
 
LVL 25

Expert Comment

by:Lee Savidge
Comment Utility
Glad to help :)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now