Tuesday, June 23, 2020

SQL Server: Get Jobs and Objects owned by user

select s.name,l.name  
from  msdb..sysjobs s 
left join master.sys.syslogins l on s.owner_sid = l.sid 
where l.name is not null and l.name = 'Jeelan'
order by l.name

SELECT *
FROM sys.objects
WHERE schema_id = SCHEMA_ID('DBO');

No comments:

Post a Comment