Cannot create db diagram

When trying to create a DB diagram on my local SQL Server 2005 db, I get the following error:

cannot insert the value null into column "diagram_id"

I have searched the web and can't seem to find anything on this.

I just simply drag one table from my local db onto the diagram windows and try to Save it and that's what I get. I'm able to save diagrams on a networked SQL Server.

Does anybody know how I can resolve this issue?

[476 byte] By [Bill_Yeager] at [2008-2-26]
# 1

Dear Bill

I am a newbie and have also experienced the same problem, on a local machine with SQL Server 2005 DE.

I have placed a similar msg on a few forums and no response to them as yet.

"MS SQL SERVER 2005 BUG? Cannot insert NULL into column diagram_id

Hi friends,

when trying to save a diagram I got an error:
The sp_creatediagram procedure attempted to return a status of NULL, which is not allowed."

Whats with this?

As far as I can work out, it has only started happening since I mucked around with the database properties such as ANSI NULLS true/false. I have put them back to default as a test and it doesnt fix the problem.

Have you got any ideas about it yet?

OxyJen at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Documentation...
# 2

This comes from the fact that the db was a prior version of sql server (via a conversion to 2005). This will not work.

You have to create the db brand new in sql server 2005, then import data from your sql server 2000 db, etc.

Bill_Yeager at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Documentation...
# 3
1. start>programs>microsoft visual studio 2005
2. file>new project>other project types>database>datbase project
3. connect to your database
4. solution explorer>database reference
5. server explorer>diagram
6. prompt: does not support diagram create?
7. click yes
joeydj at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Documentation...
# 4
Bill - is this thread closed or do you still need help? If this is closed out you can mark it as "answered". Thanks!
BuckWoody at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Documentation...
# 5
sounds good, but i had the same problem and this didn't work for me.
martinnickel at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Documentation...
# 6

I have the same problem - is there any work around, or fix available?

I have tried to create the diagram from SQL Server Management Studio and Visual Studio 2005.

KennethAlexander at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Documentation...
# 7
Are you trying to do this against SQL Server 2000 from 2005 or the other way around? Is the database set to a compatibility mode less than 9.0?
BuckWoody-MSFT at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Documentation...
# 8

I have the same issue, and I have NEVER had SQL Server 2000 on any server here.

I am only getting this error on one or two of the 7 databases that I have on the SQL server instance.

--

Is there a way to delete the diagramming "stuff" so that when the create... option is chosen in Database Diagrams, it resets all of the sp's, etc.?

BobSovers at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Documentation...
# 9
I'm not familiar with a way to do that. That isn't to say that there isn't one, so we'll leave this post open...Maybe someone will chime in!
BuckWoody-MSFT at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Documentation...
# 10

Hi,

I had this problem as well (SQL 2005) - I simply deleted the sysdiagrams table from System Tables and created a new diagram allowing it to automatically create the database objects. This seemed to solve the problem.

Nick

NickNelson at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Documentation...
# 11

Hello:

This is what I did....

1. Created a Create Query for the System Tables > dbo.sysdiagrams

2. Changed the following statement:

[diagram_id] [int] DEFAULT ((0)),

3. Deleted the table: System Tables > dbo.sysdiagrams

4. Executed the modified query

5. Saved my diagram. It worked fine

6. I was even able to create and open multiple diagrams without any problems!

software786

software786 at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Documentation...
# 12
Yes, this works. Ah, why isn't this fixed in SQL Server's updates?
WilliamVaughn at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Documentation...

SQL Server

Site Classified