Agent Jobs

Find All SQL Job Owners

Here’s some quick SQL logic to return all the Job Owners.

use master;
set nocount on

if object_id('tempdb..#job_owners') is not null
drop table	#job_owners
create table	#job_owners
server_name varchar(255)
,	job_owner_name	varchar(255)
,	job_name varchar(255)
,	date_created	datetime
insert into	#job_owners
'server_name' = @@servername
,	'job_owner_name'	= upper(suser_sname(owner_sid))
,	'job_name' = upper(
,	'date_created' = date_created
msdb..sysjobs sj

,	job_owner_name
,	job_name
,	'date_created' = left(date_created, 12) + ' ' + datename(dw, date_created) from
order by
,	job_name asc

drop table #job_owners

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s