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

FIX: Msg 15170, Level 16, This login is the Owner of 2 Job(s). You Must Delete or Reassign these Jobs Before the Login can be Dropped
by Michal Tinthofer on 26/01/2018

Recently I had an issue with this error during upgrade of SSISDB AlwaysOn Support using wizard.

Read more
Storage throughput over time
by Michal Tinthofer on 10/01/2012

Sometimes is nice to have a tool/report which could allow you to see how much your backup storage is degraded over time. Especially by fragmentation and auto growth/shrink operations.

Read more
SMT 1.0 development finished
by Michal Tinthofer on 30/10/2020

We just finished second major SMT development in 2020

Read more