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

ShowIT2019
by Michal Tinthofer on 08/02/2019

I would like to say thank you for attending my presentations on this year ShowIT.

Read more
SQLBits 2025
by Mikuláš Mráz on 25/06/2025

Last week we attended SQLBits in London - not as sponsors this time, but as curious and enthusiastic attendees.

Read more
When Database Corruption Would Not Go Away
by Michal Kovaľ on 12/07/2023

This story follows the investigation from recurring symptoms through failed conventional fixes to the storage-level change that finally stabilized the affected table.

Read more