SQL Agent Operators by Server
declare @str varchar(max)
select so.name as OperatorName, so.email_address as NotifyEmailAddr,
so.last_email_date as LastEmailDate,
STUFF((SELECT ', [' + name + ']' FROM msdb.dbo.sysjobs where notify_email_operator_id = so.id order by name FOR XML PATH('')),1,1,'') as JobsUsing
from msdb.dbo.sysoperators so
order by OperatorName
select so.name as OperatorName, so.email_address as NotifyEmailAddr,
so.last_email_date as LastEmailDate,
STUFF((SELECT ', [' + name + ']' FROM msdb.dbo.sysjobs where notify_email_operator_id = so.id order by name FOR XML PATH('')),1,1,'') as JobsUsing
from msdb.dbo.sysoperators so
order by OperatorName
0 Comments:
Post a Comment
<< Home