jump to navigation

Cannot insert the value null into column ‘diagram_id’, table dbo.sysdiagrams December 28, 2011

Posted by Bilal in SQL Server 2005.
Tags: , , , , , ,
trackback

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

cannot-insert-the-value-null-into-column-diagram_id

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.
cannot-edit-table

Open up the columns and right click on the diagram_id column and select modify
edit_table

This loads the sysdiagram design window from where you can set the default value of the diagram_id field

setdefaultvalue

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.

Source: Link

Advertisements

Comments»

1. Eric - February 28, 2012

nice tip


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: