Contact Us

To resolve the issue, first I need to find which login wizard is trying to drop. Since i didn't know, I have used this aproach:

Find job to login owner relationship:

SELECT j.job_id ,j.owner_sid ,j.name , l.name 
FROM msdb.dbo.sysjobs AS j LEFT JOIN 
sys.server_principals AS l
ON J.Owner_sid = l.sid

Then focus on owners having specific amount (2 in my case) of jobs assinged:

SELECT l.name, COUNT(*)
FROM msdb.dbo.sysjobs AS j LEFT JOIN 
sys.server_principals AS l
ON J.Owner_sid = l.sid
GROUP BY l.name
HAVING COunt(*) = 2 --here you may filter the amount of jobs owner should  own

When I knew the job owner, it was easy to list just his jobs:

SELECT l.name, COUNT(*)
FROM msdb.dbo.sysjobs AS j LEFT JOIN 
sys.server_principals AS l
ON J.Owner_sid = l.sid
GROUP BY l.name
HAVING COunt(*) = 2 --here you may filter the amount of jobs owner should  own

Hope it helps.

With regards, 

Michal.

More tips and tricks

SMT 1.10 released
by Michal Tinthofer on 25/10/2023

SMT 1.10 changelog

Read more
SMT 00.5.55 Released!
by Michal Tinthofer on 26/11/2018

While we are working hard on a next SMT version we realised that we did not publish updates that happened during the current year, let us please fix that and inform you about new features and enhancements to SMT.

Read more
Archiving strategy for DWH
by Michal Tinthofer on 22/04/2021

Recently, we have got a case where our customer requested to implement archiving strategy for their DWH. We wanted to share with you how we approached this and what was the final output.

Read more