How to fix SQL Server database diagram error "Cannot execute as the database principal because the principal 'dbo' does not exist"?

jtw3ybtb  于 2023-06-28  发布在  SQL Server
关注(0)|答案(1)|浏览(224)

When attempting to create a database diagram I get the following error:
Cannot execute as the database principal because the principal "dbo" does not exist

How do I fix this error?

zazmityj

zazmityj1#

This error occurs when the database owner for the files setting in the database properties is unassigned (or blank).

To fix this:

  • Right click on the database you need to create a diagram for.
  • Choose Files from the left hand navigation menu of the dialog box.
  • Enter sa in the owner field.
  • Click OK

This gives the sa permission to create files on the server.

src: SQL SERVER – Fix Error – Cannot execute as the database principal because the principal “dbo” does not exist

相关问题