The database owner SID recorded in the master database differs from the database owner SID recorded in database

 

ERROR:

The database owner SID recorded in the master database differs from the database owner SID recorded in database ‘database_name’. You should correct this situation by resetting the owner of database ‘database_name’ using the ALTER AUTHORIZATION statement.

EXPLANATION:

When a user wanted to run a SP in the system, he said he had encountered such an error. The TRUSTWORTHY feature was turned on in the database. Because I’ve already encountered this problem before, I knew that the problem was caused by the database owner.

SOLUTION:

The problem is solved when you set the database owner to “sa” with the following code:

You can do this with the above script, but the microsfot announces that sp_changedbowner will be removed. Instead, it recommends using the following script.

Ekrem Önsoy
Author: Ekrem Önsoy

The original article was written in Turkish by Ekrem Önsoy and translated to English by dbtut with the consent of the author. The copyright of the article belongs to the author. The author shall not be liable in any way for any defect caused by translation.

Leave a Reply

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