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.0 development finished
by Michal Tinthofer on 30/10/2020

We just finished second major SMT development in 2020

Read more
We will be presenting at ShowIT 2018.
by Michal Tinthofer on 08/01/2018

So after some time we are returning to presenting roadshow starting with Show IT Bratislava. Lets have a look at our session list.

Read more
Easy performance gain for data extensive process
by Michal Kovaľ on 24/05/2022

This is one of our tuning successes, particularly for the nightly process of loading data into a report server from the main database.

Read more