Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Check Status of SQL Service from Command line?

Author  Topic 

jeff00seattle
Starting Member

5 Posts

Posted - 2008-11-17 : 12:25:41
While running a SQL script by calling sqlcmd with DOS Batch script, I noticed that the following message was outputed:

SQLServerAgent is not currently running so it cannot be notified of this action.

Is there a way to check if SQLServer, SQLServerBrowser, or SQLServerAgent are currently running or not through Command line so that I may incorporate it within my Batch script?

Thanks

Jeff in Seattle

craig79
Starting Member

33 Posts

Posted - 2008-11-17 : 17:14:52
xp_servicecontrol 'querystate', 'SQLSERVERAGENT'
go

xp_servicecontrol 'querystate', 'MSSQLSERVER'
go

xp_servicecontrol 'querystate', 'MSSQLServerBrowser'
go



quote:
Originally posted by jeff00seattle

While running a SQL script by calling sqlcmd with DOS Batch script, I noticed that the following message was outputed:

SQLServerAgent is not currently running so it cannot be notified of this action.

Is there a way to check if SQLServer, SQLServerBrowser, or SQLServerAgent are currently running or not through Command line so that I may incorporate it within my Batch script?

Thanks

Jeff in Seattle

Go to Top of Page
   

- Advertisement -