Sql users

Last Post 09 Nov 2007 03:01 PM by StuartCoffey. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
xcao
New Member
New Member

--
17 Jan 2007 12:33 PM
I created a login in sql server 2005, then I tried to create the user in the database of by using this login.

Then without a clear concept of schema, in the window of creating users, in the top part, default schema, I chose dbo, schema owned by this user I choose the datareader, and database role membership I chose database reader and writer.

1.I don't even know this is right or not, I only want the user to be able to read the database and write to the database.
2. Also since I want to change another login name as well as the user name, I tried to delete the user, it doesn't allow me to, give the errro: the user cannot be dropped for he is the owner of a schema.

How can I drop the user?
Thanks
JHunter
New Member
New Member

--
17 Jan 2007 01:30 PM
if you go into the properties for the db_datareader schema (Security/Schemas in your database), change its owner (which will currently be set to your user) to be db_datareader. You should now be able to drop the user.

Jamie
xcao
New Member
New Member

--
18 Jan 2007 04:43 AM
Thank you all, I guess I need to learn something about schema, since it's so regularly used in 2005
StuartCoffey
New Member
New Member

--
09 Nov 2007 03:01 PM
There is the situation under SQL Server 2005 where a SQL Server 2000 database is detached, copied and attached under SQL Server 2005. In that situtation all of the existing users in the SQL Server 2000 database will be setup to have a default schema based on the domain and user name of that domain e.g. "domain"\"userid". In this situation you can drop the schema and then drop the user
e.g.
use database; drop schema "domain\userid";

then
use database; drop user "domain\userid";

You are not authorized to post a reply.

Acceptable Use Policy