TSQL To Start A SQL Agent Job

Download PDF

Most of us are familiar with the quick and easy right clicking on an agent job an select “Start job at Step…”, but what if you need to run a job on many servers how can you kick it off manually.

But what if you want to just run a TSQL command to start a job rather than right clicking through SQL Server Management Studio.

[SQL]
USE msdb ;
GO
EXEC dbo.sp_start_job N’Database Alerts To Steve’;
GO
[/SQL]

Where you can really make it interesting is to use the Registered Servers feature in SSMS and to connect to multiple SQL Servers at the same time start a job on multiple SQL Servers.

 

More from Stedman Solutions:

SteveStedman5
Steve and the team at Stedman Solutions are here for all your SQL Server needs.
Contact us today for your free 30 minute consultation..
We are ready to help!

Leave a Reply

Your email address will not be published. Required fields are marked *

*