user3802434
user3802434

Reputation: 876

Cannot Create Database Diagram in SQL Server 2019 Database

I have a SQL Server 2019 database that I restored from a SQL Server 2017 backup. It has diagrams present in the System Tables dbo.sysdiagrams table, but they are not visible. If I try to create a diagram I get an error:

enter image description here

What is the problem and how do I fix it?

Thank you,

Upvotes: 3

Views: 3406

Answers (3)

Vũ Anh Nguyễn
Vũ Anh Nguyễn

Reputation: 11

I recommend database properties > Select File > Select on Owner > Select your system account, set it, then Click on OK.

Upvotes: 1

user3802434
user3802434

Reputation: 876

The suggestion from Randy led to a resolution. In looking at the DB files properties there was no owner.

enter image description here

I tried to set the owner to my Windows logon, but that led to an error because there was an existing reference to it. Then, I set the owner to sa and that worked.

enter image description here

The diagrams are now accessible.

enter image description here

The only remaining question concerns a possible conflict with the owner of some objects assigned to my Windows login and the files owned by sa.

Upvotes: 3

Randy in Marin
Randy in Marin

Reputation: 1143

A shot in the dark...likely a good one. Check the database owner to make sure it is set. It might have been a login that is not valid on this instance. Not having a owner can cause access issues in SSMS.

Upvotes: 3

Related Questions