Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is it possible to change a database owner 1

Status
Not open for further replies.

shanghai2004

Programmer
Dec 16, 2004
37
CA
Dear Expert,

Is it possible to change a database owner to sa?
I created a new database by restoring from a database backup. The owner of the existing database is sa. But the owner of the new database is ATHENA\Administrator. (Here ATHENA is the server name). How do I make the new database to have the same owner as the database restored from?

Thanks
 
Lookup sp_changedbowner
This worked for me

Code:
use master
go
create Database testowner
go

USE testowner
GO
EXEC sp_changedbowner 'sa'

And this will be the message

The dependent aliases were mapped to the new database owner.
Database owner changed.

Denis The SQL Menace
SQL blog:
Personal Blog:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top