tags:

views:

24

answers:

2

Hello,

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

+2  A: 

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
SQLMenace
Thank You! The top one works... but the bottom one gives me an invalid object name error 'msdb..sysssispackages'... Do I not have something installed that I should for the SSIS stuff?
M Murphy
on sql 2005 you need to use sysdtspackages90, that got changed with sysssispackages in 2008, see also http://wiki.lessthandot.com/index.php/List_all_SSIS_packages_and_the_owner_of_those_SSIS_packages
SQLMenace
A: 

A colleague told me about this stored procedure...

USE msdb

EXEC dbo.sp_help_job

M Murphy