Sql Job to run a Batch file
Suppose my package name is PRELOAD_SDID\PKG_SSIS_WITH_MOL_PROV.dtsx and it is situated at the file path D:\Projects\Norway_MA\Packages\SSIS WITH MOL AND PROV COVER\SDID_LOAD_COMBINED_V2_TEST_EXCEL.
To create a windows scheduler for running the package, I need to write a batch file in which the command will be :
“C:\Program Files\Microsoft SQL Server\100\DTS\Binn\dtexec.exe” /FILE “D:\Projects\Norway_MA\Packages\SSIS WITH MOL AND PROV COVER\SDID_LOAD_COMBINED_V2_TEST_EXCEL\PRELOAD_SDID \PKG_SSIS_WITH_MOL_PROV.dtsx” /MAXCONCURRENT ” -1 ” /CHECKPOINTING OFF >>logNorwayMA.txt
Now my target is to run this batch file using a sql job. To do so,
- Open sql server.
- on object explorer tab, select sql server agent and expand the jobs.
- select new job.
- In general tab, named the job and select the category as uncategorized(local).
- Select steps tab and select new steps. Then name the step name, select type as Operating system(CmdExe). In the command open the batch file or write the command cmd.exe /c “D:\Projects\mybatch.cmd”. Here mybatch.cmd is the batch file and D:\Projects\mybatch.cmd is it’s path.
- Then select OK and job is ready.
To create a credential…….
- Expand Security and select credential and select new credential. then create the credential.
- Expand Sql server Agent and then expand Proxies.
- Name the proxy
- Select Credential
- Select the Subsystem.
This has worked fine.
 
