I got following error when I was trying to delete user ‘test’ with ‘SA’ login. I was little surprised but then I tried to delete with the windows authenticated systemadmin account. Once again I got the same error.
Msg 15151, Level 16, State 1, Line 3Cannot drop the login ‘test’, because it does not exist or you do not have permission.
The reason I was surprised that I was systemadmin and I should be allowed to delete the login. I am including the script which I used to delete the account here.
IF EXISTS (SELECT * FROM sys.server_principals WHERE name = N’Test’)
DROP LOGIN [Test]
Fix/Workaround/Solution:
I finally found out that error was misleading. I had another session open in SQL Server Management Studio with username ‘test’ and it was preventing me to drop the user. Once I closed that open session I was successfully able to delete the user using above script.
In Normal Case:Following error usually show up when user is logged in, which I did not get it.
Msg 15434, Level 16, State 1, Line 3
Could not drop login ‘test’ as the user is currently logged in.
However, when I tried to re-create scenario I got above error. I want to share this experience with users and want to know if they have ever faced this scenario.
Kaydol:
Kayıt Yorumları (Atom)
BlackListIP control on Serenity platform (.NET Core)
In the Serenity platform, if you want to block IPs that belong to people you do not want to come from outside in the .net core web project,...
-
In the Serenity platform, if you want to block IPs that belong to people you do not want to come from outside in the .net core web project,...
-
TABLO ADI AÇIKLAMA L_PERSONEL Çalışma Alanı Tanımları L_SYSLOG Kullanıcı Kaydı İzleme L_L...
-
Microsoft OLE DB Provider for SQL Server : Cannot create a row of size 8100 which is greater than the allowable maximum of 8060. (80040E14) ...
Hiç yorum yok:
Yorum Gönder