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.
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.
The problem is solved when you set the database owner to “sa” with the following code:
EXEC sp_changedbowner 'sa'
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.
ALTER AUTHORIZATION ON DATABASE::MyDatabase TO sa;