Monday, August 08, 2011

check sql agent running with tsql

if 0<(select count(*) from sysprocesses where program_name like 'SQLAgent%')
begin
print 'sql agent is running'
end
else
begin
print 'sql agent is not running'
end

No comments: