How to Change Ownership of a Database in SQL Server

In the following example we will change the ownership of Sales database.



By using the both way we can change the ownership. In that  example we changed the ownership to sa. 

Use Sales

--EXEC sp_changedbowner 'New Owner Login'
EXEC sp_changedbowner 'sa'

Or

ALTER AUTHORIZATION ON Database:: Sales TO [SA]



Comments