Code Makes Sure the SQL Agent Service Is Running

Many programs depend on the SQL Agent Service. This code ensures that the SQL Agent Service is running.

Readers

April 14, 2005

1 Min Read
ITPro Today logo in a gray background | ITPro Today


Many of the programs I’ve written depend on the SQL Agent Service. To make sure that no one has configured this service to run manually (I’ve encountered many idiosyncrasies in my job), I rely on the piece of code that Listing 1 shows. This code ensures that the SQL Agent Service is running. You can also transform it into a startup procedure, as Listing 2 shows.

— Andre Vigneau
[email protected]

Editor’s Note
Share your SQL Server discoveries, comments, problems, solutions, and experiences with products and reach out to other SQL Server Magazine readers. Email your contributions (400 words or less) to [email protected]. Please include your phone number. We edit submissions for style, grammar, and length. If we print your submission, you’ll get $50.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like