Wednesday, March 28, 2012

Saving New Diagrams

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!REK (REK@.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, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||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...
"Erland Sommarskog" wrote:

> REK (REK@.discussions.microsoft.com) writes:
> 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, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx
>|||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 an
d
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.
"Erland Sommarskog" wrote:

> REK (REK@.discussions.microsoft.com) writes:
> 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, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx
>sql

No comments:

Post a Comment