Our Blog

It sounds like your sysdiagrams table somehow lost the IDENTITY property on the diagram_id column.  Using the following SQL I was able to drop the sysdiagrams table and rebuild.  Note you will lose any existing diagrams (if you had any during this process)

DROP TABLE dbo.sysdiagrams;
CREATE TABLE [dbo].[sysdiagrams]
    [name] [sysname] NOT NULL,
    [principal_id] [int] NOT NULL,
    [diagram_id] [int] IDENTITY(1,1) PRIMARY KEY,
    [version] [int] NULL,
    [definition] [varbinary](max) NULL,
    CONSTRAINT [UK_principal_name] UNIQUE ([principal_id],[name])

EXEC sys.sp_addextendedproperty 
  @value=1 , 

Note: SSMS v18 release notes

I resolved this issue by setting database owner. My database did not have had any owner before this issue. Execute this command in your database to set owner to sysadmin account

use [YourDatabaseName] EXEC sp_changedbowner 'sa'


About Us

Web/Mobile Solutions

Our Contacts

Cincinnati, OH 45069