jfvassar
asked on
How can I execute a DOS command file from SSIS?
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you can use a Execute Process task in Control flow and then select the path of your Batch file
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)
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)
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
ASKER
set shell=nothing is required at the end of the task :-)