Question

HowTo Generate List of SQL Server Jobs and their owners

How would I go about generating a list of sql jobs and their owners? I would also like to be able to generate this list for SSIS packages also.

Thanks

 45  161453  45
1 Jan 1970

Solution

 75

try this

Jobs

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

Packages

select s.name,l.name 
from msdb..sysssispackages s 
 left join master.sys.syslogins l on s.ownersid = l.sid
2010-09-21

Solution

 49

It's better to use SUSER_SNAME() since when there is no corresponding login on the server the join to syslogins will not match

SELECT  s.name ,
        SUSER_SNAME(s.owner_sid) AS owner
FROM    msdb..sysjobs s 
ORDER BY name
2015-05-11