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;
GO
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])
);

GO
EXEC sys.sp_addextendedproperty 
  @name=N'microsoft_database_tools_support', 
  @value=1 , 
  @level0type=N'SCHEMA',
  @level0name=N'dbo', 
  @level1type=N'TABLE',
  @level1name=N'sysdiagrams';
GO

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'

image

About Us

Web/Mobile Solutions

Our Contacts

Cincinnati, OH 45069