Home All Groups Group Topic Archive Search About
Author
26 Nov 2005 8:40 PM
REK
I keep getting this message when attempting to save a new diagram:

TITLE: Microsoft SQL Server Management Studio
------------------------------

Cannot insert the value NULL into column 'diagram_id', table
'JobTracker.dbo.sysdiagrams'; column does not allow nulls. INSERT fails.
The statement has been terminated.
The 'sp_creatediagram' procedure attempted to return a status of NULL, which
is not allowed. A status of 0 will be returned instead. (.Net SqlClient Data
Provider)

------------------------------
BUTTONS:

OK
------------------------------

I've established proper ownership for the database and enabled diagrams. 
The Diagrams UI loads, I can pull in as many tables as I like and do
everything else one would do within the Diagram view, but saving, whether
it's with a single table or multiples, always generates this error.

Any help really appreciated!

Author
26 Nov 2005 11:58 PM
Erland Sommarskog
REK (R**@discussions.microsoft.com) writes:
> I keep getting this message when attempting to save a new diagram:
>
> TITLE: Microsoft SQL Server Management Studio
> ------------------------------
>
> Cannot insert the value NULL into column 'diagram_id', table
> 'JobTracker.dbo.sysdiagrams'; column does not allow nulls. INSERT fails.
> The statement has been terminated.
> The 'sp_creatediagram' procedure attempted to return a status of NULL,
> which is not allowed. A status of 0 will be returned instead. (.Net
> SqlClient Data Provider)

Now, that's spooky. Obviously, the table sysdiagrams table in your
database does not have the IDENTITY property. You can check this by
running "JobTracker..sp_help sysdiagrams".

A faint possibility there is a SET IDENTITY_INSERT active for that table.
If this is the case, disconnecting from the server in Object explorer
should be enough.

If the table really is missing the IDENTITY property, the best may be
to drop all objects related to digrams, and hope that Mgmt Studio
succeeds better next time.


--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Author
27 Nov 2005 8:32 PM
REK
Erland,

Thanks for your reply.  You're correct, I didn't scope the table for an
identity column, but after doing so there is not one set.

To be fair this was a db I had previously created in SQL 2000, but I figured
after going through the ownership assignment and setting the db to use
diagrams all would be good.  Something obviously went sideways.

I don't have this issue in other databases in SQL 2005, so I'll just create
a new one and import my existing architecture.  I don't have alot of time to
chase system issues...



Show quote
"Erland Sommarskog" wrote:

> REK (R**@discussions.microsoft.com) writes:
> > I keep getting this message when attempting to save a new diagram:
> >
> > TITLE: Microsoft SQL Server Management Studio
> > ------------------------------
> >
> > Cannot insert the value NULL into column 'diagram_id', table
> > 'JobTracker.dbo.sysdiagrams'; column does not allow nulls. INSERT fails.
> > The statement has been terminated.
> > The 'sp_creatediagram' procedure attempted to return a status of NULL,
> > which is not allowed. A status of 0 will be returned instead. (.Net
> > SqlClient Data Provider)
>
> Now, that's spooky. Obviously, the table sysdiagrams table in your
> database does not have the IDENTITY property. You can check this by
> running "JobTracker..sp_help sysdiagrams".
>
> A faint possibility there is a SET IDENTITY_INSERT active for that table.
> If this is the case, disconnecting from the server in Object explorer
> should be enough.
>
> If the table really is missing the IDENTITY property, the best may be
> to drop all objects related to digrams, and hope that Mgmt Studio
> succeeds better next time.
>
>
> --
> Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
>
Author
27 Nov 2005 9:09 PM
REK
Just a quick follow-up: I created a new db and imported the architecture and
had the same issue with saving diagrams.  I scripted the sysdiarams table and
added the Identity(1,1) value to the diagram_id column and everything is now
functioning.

Seems to be something with importing my JobTracker tables from their
previous db.

Show quote
"Erland Sommarskog" wrote:

> REK (R**@discussions.microsoft.com) writes:
> > I keep getting this message when attempting to save a new diagram:
> >
> > TITLE: Microsoft SQL Server Management Studio
> > ------------------------------
> >
> > Cannot insert the value NULL into column 'diagram_id', table
> > 'JobTracker.dbo.sysdiagrams'; column does not allow nulls. INSERT fails.
> > The statement has been terminated.
> > The 'sp_creatediagram' procedure attempted to return a status of NULL,
> > which is not allowed. A status of 0 will be returned instead. (.Net
> > SqlClient Data Provider)
>
> Now, that's spooky. Obviously, the table sysdiagrams table in your
> database does not have the IDENTITY property. You can check this by
> running "JobTracker..sp_help sysdiagrams".
>
> A faint possibility there is a SET IDENTITY_INSERT active for that table.
> If this is the case, disconnecting from the server in Object explorer
> should be enough.
>
> If the table really is missing the IDENTITY property, the best may be
> to drop all objects related to digrams, and hope that Mgmt Studio
> succeeds better next time.
>
>
> --
> Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
>

AddThis Social Bookmark Button