How to change database owner

How to change database owner

Post by jen » Sat, 21 Sep 2002 11:32:01



Hi,

Can someone tell me how to change the owner of a database?

Pardon me for being vague here, but I did try a stored procedure (sp_changedb?
or sp_changeowner?) that the help described as doing that, but I got a message
like "(owner) is already a (user, or something like user) of database (db)".
This was in fact true, that the owner name I was trying to give the database is
also a user assigned to the database.

Thanks for anything.

 
 
 

How to change database owner

Post by Dan Guzma » Sat, 21 Sep 2002 13:07:37


You'll need to drop the user from the database before changing ownership
to that login.  Once database ownership is changed, that login becomes
the dbo user.

The reason for the message is that a login can be mapped to only one
database user.

--
Hope this helps.

Dan Guzman
SQL Server MVP

-----------------------
SQL FAQ links (courtesy  Neil Pike):

http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
-----------------------


Quote:> Hi,

> Can someone tell me how to change the owner of a database?

> Pardon me for being vague here, but I did try a stored procedure
(sp_changedb?
> or sp_changeowner?) that the help described as doing that, but I got a
message
> like "(owner) is already a (user, or something like user) of database
(db)".
> This was in fact true, that the owner name I was trying to give the
database is
> also a user assigned to the database.

> Thanks for anything.


 
 
 

1. How to change database owner from dbo

Hi,

Some of my tables that I create are assigned "dbo" as the owner, instead of
the username that I'm connected with. This is somewhat disturbing since a
table that I name e.g. Restaurants come out being called dbo.Restaurants.

Is there any way to change the owners of these tables, or make sure that
when I create a new table this won't happen?

Thank you in advance!

- Peter Larsson -

2. test - do not read

3. How to change Database owner in MMC???

4. Printing Problem!!

5. Change DB owner/Table owner

6. changing SE to ONLINE

7. A database owner is not reconized as a database owner

8. UDF return value data type

9. how to change a database owner...

10. SA is not owner of database need to change

11. changing database owner

12. Change Database Owner -- syntax

13. changing the owner of database.