We can create a batch file to run the SSIS package, using DTExec utility (32 bit or 64 bit utility). We can pass variables value also through batch file.
Note: Follow the below command and prepare a text file. Save the text file with ".bat" extension.If we double click on the batch file, then package execution will start.
Batch (.bat) file for SSIS package using 32 bit utility:
"C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe" /f "D:\Sample_Packages\Test_Package.dtsx"
Batch (.bat) file for SSIS package using 64 bit utility:
"C:\Program Files\Microsoft SQL Server\100\DTS\Binn\DTExec.exe" /f "D:\Sample_Packages\Test_Package.dtsx"
Passing variable value through batch file:
"C:\Program Files\Microsoft SQL Server\100\DTS\Binn\DTExec.exe" /f "D:\Sample_Packages\Test_Package.dtsx" /SET \Package.Variables[User::Variable_Name].Value;"Variable_Value"
Note: If we need to pass variable value as a path (file or folder), in that path we need to replace "\" with "\\".
Example: If required path is D:\Sample_Packages\Source_Folder\Sample.txt. We need to pass this path like this D:\\Sample_Packages\\Source_Folder\\Sample.txt in a batch file.
No comments:
Post a Comment