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 00.6.00 Released!
by Jiri Dolezalek on 20/05/2020

Dear SMT users, We are glad to announce that a new version 00.6.00 is finally out.

Read more
Data Point Prague 2025
by Mikuláš Mráz on 09/06/2025

Last week of May we had the pleasure of sponsoring another great data event - Data Point Prague, held at the Comfort Hotel in Prague.

Read more
How One App Held an Availability Group Hostage
by Michal Kovaľ on 25/05/2021

In the world of SQL Server, TEMPDB is often called the "public dumping ground." We expect it to be busy, but we also expect it to clean up after itself.

Read more