I have a stored procedure that checks the status of several remote sql servers (mixture 7/2000) It runs:
select program_name from serevr_name.master.dbo.sysprocesses where program_name like 'SQLAgent%'
simply to see if the agent service is running. The problem is that if the actual sql server service itself is stopped the SP crashes out with "SQL Server does not exist or access denied." messages.
I can't seem to find any way to trap these messages as the usual @@error doesn't trap it.
Or is there another way to automatically check the status of remote servers?
Thanks