drop failed for login test or not able to drop a login in SQL server
ERROR:
i wanted to drop a TEST login that i have created some days back ..
i was getting below error
i checked and closed all query window connections and also all SSMS object explorer connection from this particular login
but still i got the same error again ….
CAUSE ::
i looked into the results of sysprocesses to see if anything is still connected VIA TEST login ..
i Figured out a program named Microsoft SQL Server Management Studio – Transact-SQL IntelliSense
was connected to Server VIA .. login named TEST .. that is to say intelliSense remains connected to SQL server long after the the query analyzer and SSMS connections are explicitly closed ..
i used below query to kill .. these IntelliSense connections and i was able to drop the TEST login
select ‘KILL’ + ‘ ‘ + cast (spid as char(5)),*
from sysprocesses where spid > 50 and program_name like ‘%IntelliSense%’ and loginame like ‘name of the login you want to drop’
KILL 88
KILL 104
enjoy 🙂
-
June 25, 2013 at 12:57 ampost-151097