question

Sagar Bhargava avatar image
Sagar Bhargava asked

Unable to drop a Login

Hi, I am trying to drop a login from my SQL Server but I am getting the below error: Drop failed for Login ''. (Microsoft.SqlServer.Smo) ------------------------------ Login '' has granted one or more permission(s). Revoke the permission(s) before dropping the login. (Microsoft SQL Server, Error: 15173) I see the login has granted Connect permission to a user on the database. When I use the below SQL to revoke it, it gives me a Syntax error REVOKE CONNECT ON LOGIN:: [] FROM [SQL_Login] Msg 102, Level 15, State 1, Line 0 Incorrect syntax near 'CONNECT...'. Please help fix and identify where I am missing anything.
permissionsaccess
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
David Wimbush avatar image
David Wimbush answered
It looks to me like you need to do this: USE ; REVOKE CONNECT FROM ; See Books Online for more details: https://msdn.microsoft.com/en-us/library/ms177573.aspx
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.