Solved

How can I execute a DOS command file from SSIS?

Posted on 2010-08-31
5
999 Views
Last Modified: 2013-11-10
I thought the step would just be Type = Operating System (CmdExec) and then reference the path and name of the .bat file I want SQL Server to execute.  
0
Comment
Question by:jfvassar
[X]
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
5 Comments
 
LVL 16

Accepted Solution

by:
carsRST earned 50 total points
ID: 33567899
Add an ActiveX script task and try something like this.

dim shell
set shell=createobject("wscript.shell")
shell.run "myBatFile.bat"

Also-you might get better responses if you bump up the points.  :)
0
 
LVL 16

Expert Comment

by:vdr1620
ID: 33567904
you can use a Execute Process task in Control flow and then select the path of your Batch file
0
 

Expert Comment

by:viralbhatt
ID: 33567953
Create a batch file that looks something like this (SQLTest.bat);


SET SQLCMD=sqlcmd -S ServerName -d dbaseName -U sa -P Password -o 'c:\logfile..log'
%SQLCMD% -i 'c:\file1.sql'
%SQLCMD% -i 'c:\file2.sql'
%SQLCMD% -i 'c:\file3.sql'

Then execute the batch file
(Line 1 establishes a connection, then lines 2 to 4 are the files to execute)
0
 
LVL 16

Expert Comment

by:vdr1620
ID: 33568014
ActiveX script task is being deprecated in feature versions and is only available to support previous DTS packages..i would suggest you to avoid using ActiveX script Task
0
 

Author Closing Comment

by:jfvassar
ID: 33665661
set shell=nothing is required at the end of the task  :-)
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how the fundamental information of how to create a table.

691 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