May 20, 2003 at 4:17 am
Hi,
Within a stored proc I need to check if the MSSQLServer service is started on a remote server before trying to connect and thus receiving an error message. Any ideas?
Cheers.
May 20, 2003 at 7:09 am
Within T-SQL, I would get a sev 16 error and that would be all she wrote. I ended up putting ADO code in a DTS package. That's one option.
Another option is if you have access to xp_cmdshell (be aware of the security consequences). You can use a tool like pslist to check to see if a particular process is present and parse the output coming back from xp_cmdshell.
K. Brian Kelley
http://www.truthsolutions.com/
Author: Start to Finish Guide to SQL Server Performance Monitoring
http://www.netimpress.com/shop/product.asp?ProductID=NI-SQL1
K. Brian Kelley
@kbriankelley
May 20, 2003 at 7:15 am
quote:
Another option is if you have access to xp_cmdshell (be aware of the security consequences). You can use a tool like pslist to check to see if a particular process is present and parse the output coming back from xp_cmdshell.
Another option that goes into the same direction (www.sysinternals.com) as Brian mentioned is psservice.
Cheers,
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
May 20, 2003 at 9:46 am
Yup, that's true. Go with Frank's suggestion if you're going down the xp_cmdshell route. Since both SQL Server and SQL Server Agent are services, psservice is the better option over pslist.
K. Brian Kelley
http://www.truthsolutions.com/
Author: Start to Finish Guide to SQL Server Performance Monitoring
http://www.netimpress.com/shop/product.asp?ProductID=NI-SQL1
K. Brian Kelley
@kbriankelley
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply