This is due to that the SID for the dbo inside the database does not match the owner_sid in sys.databases.
A simple way out is to change the database owner:
ALTER AUTHORIZATION ON DATABASE::YourDB TO YourDomain\YourUser
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am using SQL Server Management Studio (version 18.12.1) and just restored a database not created by me, and when I try to create a DB diagram I get an error like this:
Cannot execute as thee database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission, (Microsoft SqlServer Error: 15517)
The database is Microsoft SQL Server Express version 15.0.4153.1
If I create a database from scratch I can create db diagrams!!! But not with these other databases... what can I do to fix this?
This is due to that the SID for the dbo inside the database does not match the owner_sid in sys.databases.
A simple way out is to change the database owner:
ALTER AUTHORIZATION ON DATABASE::YourDB TO YourDomain\YourUser