I am getting this message for some users when executing sp_revokedbaccess
procedure for database users. Users I am trying to remove are selected from sys.database_principals
with type = S, W or G (sql server or windows users) and are not system users (principal_id > 4).
I checked if the user I can't remove owns any schema and it is not the case. The user is not an orphan user also. I am comparing a user that was removed and a user that gave me this error and can't find any differences. I do see the user in the database security folder so it does exist and has a corresponding server login (no sid mismatch).
Also, I am a sysadmin
on a server level and should have permissions. I have been stuck with this for the last couple of days and can't solve it. I am not a DBA, just a developer and maybe there is something else I am missing. Please help.
Here is a screenshot of sys.database_principals
. No problem with the first user (principal id = 7) but getting "Cannot drop the user...." with the second one (principal_id = 8):
select * from sys.database_principals
? (I understand not wanting to post security info publicly.)