My disk crashed so I reinstalled SQL Server to a new drive and restored my databases from my backup drive. However, when I attempt to install Diagram support, I get this message:

Cannot execute as the database principal because the principal "dbo" does not exist....

This issue is admirably answered here but the reply doesn't seem to apply in my case since running the first query in the "Solution" section returns no records so I have nothing to fix, yet I get that error message.

Here are my results from the queries suggested in that reply: Database Principals Server Principals

Please inform me how to resolve this matter.

  • What is the result of SELECT [name], SUSER_SNAME(owner_sid), owner_sid FROM sys.databases WHERE [name] = '<db name>'? – HandyD Nov 28 '19 at 6:03

The owner of your database on the old server was some Windows account that does not exists as login on the new server (if it existed, its login sid would match user sid as it's Windows account, so it's Windows sid).

To fix it you can make sa the owner of your database:

alter authorization on database::YourDBName to sa

Or any other login (I just don't see other logins on your picture that are not certificate logins)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.