List all SQL Agent jobs and the owner of those jobs

The code below will list all the SQL Agent jobs on your server and also the name of the owner of those jobs.

select s.name,l.name,*
 from  msdb.sys.sysjobs s
 left join master.sys.syslogins l on s.owner_sid = l.sid

No comments:

Post a Comment