In this tutorial you will learn how to run a sql server agent job from a batch file.For this you don’t need to know any coding.
- Create a job in Sql server to take backup of any database.
- Give it name whatever you want and save the job.
- Save the below query as batch file.
- Run it and you get your result.
Query To Run:-
SQLCMD -Q "EXEC msdb.dbo.sp_start_job @job_name='job name'"