Resetting the database owner (dbo) after restoring a backup in Microsoft SQL Server.

If you receive this advice from Microsoft SQL Server: “You should correct this situation by resetting the owner of database ‘mydatabase’ using the ALTER AUTHORIZATION statement.”

I found the easiest solution is to actually drop the existing user account in the database and then change the owner to the server’s login account using the following commands:

use mydatabase

exec sp_dropuser "user_acct" — security user in the database
exec sp_changedbowner "user_acct" — security login in the server

Leave a Reply

Your email address will not be published. Required fields are marked *