Cannot insert the value null into column ‘diagram_id’, table dbo.sysdiagrams December 28, 2011Posted by Bilal in SQL Server 2005.
Tags: database transfer, development, Diagram, Microsoft SQL Server, production, SQL, sql 2000
When ever I copy the database from the production server to the development machine the database throws an error when updating a database diagram or creating a new database diagram. The error in question is
The solution to this problem is rather simple go to dbo.sysdiagram table and set change the diagram_id default value to 0. However when you right click to bring up the design window for the dbo.sysdiagram table the option is disabled.
This loads the sysdiagram design window from where you can set the default value of the diagram_id field
Save the changes and you will be able to update existing database diagrams and create new database diagrams.
Note this solution may not work for ever and has only been tested on sql server 2005.