Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 How to Drop User Login
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

erikkl2000
Starting Member

USA
15 Posts

Posted - 08/06/2006 :  15:41:21  Show Profile
Hi,

I am trying to drop a user login from my database and i can not get this drop to happen with out an exception. For example when i try to remove the user mappings and click ok i get an exception of:::

TITLE: Microsoft SQL Server Management Studio
------------------------------

Drop failed for User 'dbo'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Drop+User&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Cannot drop the user 'dbo'. (Microsoft SQL Server, Error: 15150)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.2047&EvtSrc=MSSQLServer&EvtID=15150&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------

i have tried to reproduce this error by creating another user and mapping its username to databases and then unmap and there is not problem.. What do i do?

erik



EXEC sp_changedbowner 'UserLogin'

nr
SQLTeam MVY

United Kingdom
12543 Posts

Posted - 08/06/2006 :  16:42:59  Show Profile  Visit nr's Homepage
You are trying to drop dbo?

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

erikkl2000
Starting Member

USA
15 Posts

Posted - 08/06/2006 :  16:49:53  Show Profile
Yes
Go to Top of Page

erikkl2000
Starting Member

USA
15 Posts

Posted - 08/06/2006 :  16:57:01  Show Profile
That error accrues when i try to remove a user mapping...
Go to Top of Page

nr
SQLTeam MVY

United Kingdom
12543 Posts

Posted - 08/06/2006 :  18:21:15  Show Profile  Visit nr's Homepage
You can't drop dbo - it is the databae owmner.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

erikkl2000
Starting Member

USA
15 Posts

Posted - 08/06/2006 :  20:32:13  Show Profile
I know this is an easy one but i have just resently started really paying attention to things like users and roles..

When i right click on a user at server level i get the propertys for that user. Now i try to remove the user mapping from a table and i get this error.. So what i have done is create a database under this username and now i can not remove the mappings from this user for that reason?

erik
Go to Top of Page

erikkl2000
Starting Member

USA
15 Posts

Posted - 08/06/2006 :  21:14:56  Show Profile
Here is a photo of my enviroment as i walk through these six steps

http://www.constructionsupercenter.com/Help/Sql/HowTo-Remove-UserLogin-sql.jpg

1. Select User
2. Right click for propertys
3. Choose User Mappings
4. Remove User Mappings
5. Click Ok
6. Recieve execption
Go to Top of Page

nr
SQLTeam MVY

United Kingdom
12543 Posts

Posted - 08/06/2006 :  21:55:41  Show Profile  Visit nr's Homepage
what i have done is create a database under this username and now i can not remove the mappings from this user for that reason?

I suspect that is the case. The user will be the database owner. You will need to make someone else the database owner (sp_changedbowner) then maybe you can remove the user.
Bit surprised you get that error for this though.

If that doesn't fix it look at master..syslogins and db..sysusers to check the sid mappings.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.

Edited by - nr on 08/06/2006 21:57:49
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2019 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000