Thursday, February 28, 2008

sp_changedbowner - SQL Change DB Owner

- Changes the owner of the current database.

After sp_changedbowner is executed, the new owner is known as the dbo user inside the database. The dbo has implied permissions to perform all activities in the database.

The owner of the master, model, or tempdb system databases cannot be changed.
To display a list of the valid login values, execute the sp_helplogins stored procedure.
Executing sp_changedbowner with only the login parameter changes database ownership to login and maps the aliases of users who were previously aliased to dbo to the new database owner.

Only members of the sysadmin fixed server role can execute sp_changedbowner.


Example
This example makes the user Emil the owner of the current database and maps
existing aliases to the old database owner to Emil.


EXEC sp_changedbowner 'Emil'

7 comments:

Câmera Digital said...

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Câmera Digital, I hope you enjoy. The address is http://camera-fotografica-digital.blogspot.com. A hug.

Jonathan said...

WoW nice blog buddy!Actually WoW is my favorite appreciation keyword. I also like to play. Wow Gold. I was looking for info regarding that and saw your website. Its nice and very interesting.

lala said...

Thanks for your post and welcome to check: here.

difff said...

The site SQL Reports has a great SQL tutorial. Highly recommended for people just getting started on SQL selects.

SQL Reports

Iaroslav Kovtunenko said...

Thank you for the post.

Илья said...

Thank's a lot!

Илья said...

Thank's a lot!