May 8, 2013 at 7:33 pm
I've got the following error when I try to delete a login using MS SQL Server Management Studio:
Drop failed for Login 'test'. (Microsoft.SqlServer.Smo)
Additional information:
Cannot drop the user 'test', because it does not exist or you do not have permission.
I've checked there's no session with this login, no SQL jobs or objects are owned by this login. Can anyone help with this? Thanks.
May 8, 2013 at 10:49 pm
Where is the login located, within the database or within SQL Server? I've seen where a user has permissions on one server, the database is backed up and moved to another server, and that login still exists with rights for the database, even though they don't actually exist on that server.
Second question: which user are you logged in under when trying to delete the test user?
--------
For SQL Tips, check out my blog: http://lantztechknowledge.blogspot.com/[/url]
You can also follow my twitter account to get daily updates: @BLantz2455
May 8, 2013 at 11:14 pm
THe login is within SQL Server, I logged in under a user which belongs to sysadam fixed server role, I expect I can remove any login if I belong to sysadmin role.
May 8, 2013 at 11:24 pm
Does the test user have any securables? If so, those need to be removed first before the user can be removed.
--------
For SQL Tips, check out my blog: http://lantztechknowledge.blogspot.com/[/url]
You can also follow my twitter account to get daily updates: @BLantz2455
May 8, 2013 at 11:30 pm
do you mean if the test login owns any objects? I used the following query to check if the login 'test' owns any object, the result is it doesn't own any objects.
SELECT
so.name AS 'ObjectName'
,su.name AS 'OwnerName'
FROM sysobjects so
JOIN
sysusers su
ON so.uid = su.uid
WHERE xtype <> 's'
ORDER BY 2
May 9, 2013 at 12:29 am
Try this--
ALTER DATABASE [DATABASE_NAME]
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE
DROP LOGIN [Test2]
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
May 9, 2013 at 1:05 am
Hi eddy,
Please Use sp_msloginmappings and check test user detail and then delete from that database.
or post details for test user.
May 9, 2013 at 1:31 am
With the Login 'test', DBName=null, UserName=null, AliasName=null
One more question, is the deletion of the sql server login managed by Windows Domain security as well? is it possible the delete permission is disabled by Windows Domain Security? Thanks.
May 9, 2013 at 3:22 am
hi eddy,
i don't think that Windows Domain security restrict to drop sql server user.
Its a dumb thought but can u please refresh server and see that user is exist or not.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply