Showing posts with label insert. Show all posts
Showing posts with label insert. Show all posts

Tuesday, March 27, 2012

Cannot enter data into database

I'm a SQL newbie and am totally perplexed. I have tried to enter the
following data and I get the subsequent message.
INSERT INTO t_Answer ( AnswerID, AssessmentID, QuestionID, EvaluationValue,
AnswerText, CreationUser_ID, RevisionUser_ID )
VALUES ( 457 , 130, 4, '14', 'testing what I want to do better', 152, 152 )
Server: Msg 241, Level 16, State 1, Line 1
Syntax error converting datetime from character string.
As you can see, I'm not entering any datetime data. I do, however, have two
fields that are date time fields.
I don't know what to do next so that i can enter data in the database.
I've tried to enter info into another table and got the same message.
Thanks for your help,
KarolusHi
At http://www.aspfaq.com/etiquette.asp?id=5006 there is instructions to post
DDL which would tell us what datatypes your columns are.
Check if there are any triggers on this table or invalid defaults e.g.
CREATE TABLE MyDate ( ID INT, ADATE datetime NOT NULL DEFAULT 'Help' )
INSERT INTO MyDate (id) values (1)
gives your error.
John
"Karolus" wrote:

> I'm a SQL newbie and am totally perplexed. I have tried to enter the
> following data and I get the subsequent message.
> INSERT INTO t_Answer ( AnswerID, AssessmentID, QuestionID, EvaluationValue
,
> AnswerText, CreationUser_ID, RevisionUser_ID )
> VALUES ( 457 , 130, 4, '14', 'testing what I want to do better', 152, 152
)
> Server: Msg 241, Level 16, State 1, Line 1
> Syntax error converting datetime from character string.
> As you can see, I'm not entering any datetime data. I do, however, have t
wo
> fields that are date time fields.
> I don't know what to do next so that i can enter data in the database.
> I've tried to enter info into another table and got the same message.
> Thanks for your help,
> Karolus|||Thanks, John, I got the document. Here is the table definition. (Thanks fo
r
the advice.)
CREATE TABLE [t_Answer] (
[AnswerID] [CodeID] NOT NULL ,
[AssessmentID] [CodeID] NOT NULL ,
[QuestionID] [CodeID] NOT NULL ,
[EvaluationValue] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[AnswerText] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[RecordStatusID] [RecordStatusID] NOT NULL ,
[RecordID] [RecordID] IDENTITY (1, 1) NOT NULL ,
[CreationUser_ID] [KeyForeign] NOT NULL ,
[CreationDtm] [DateTmCreated] NOT NULL ,
[RevisionUser_ID] [KeyForeign] NOT NULL ,
[RevisionDtm] [DateTimeRequired] NOT NULL ,
CONSTRAINT [COMMENTID] PRIMARY KEY CLUSTERED
(
[AnswerID],
[AssessmentID],
[QuestionID]
) ON [PRIMARY] ,
CONSTRAINT [fk_Answer_AssessmentID_Assessment] FOREIGN KEY
(
[AssessmentID]
) REFERENCES [t_Assessment] (
[AssessmentID]
),
CONSTRAINT [fk_Answer_QuestionID_QuestionID] FOREIGN KEY
(
[QuestionID]
) REFERENCES [t_QuestionID] (
[QuestionID]
)
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
I hope this information is helpful. I don't understand what I'm screwing up
.
"John Bell" wrote:
> Hi
> At http://www.aspfaq.com/etiquette.asp?id=5006 there is instructions to po
st
> DDL which would tell us what datatypes your columns are.
> Check if there are any triggers on this table or invalid defaults e.g.
> CREATE TABLE MyDate ( ID INT, ADATE datetime NOT NULL DEFAULT 'Help' )
> INSERT INTO MyDate (id) values (1)
> gives your error.
> John
> "Karolus" wrote:
>|||Please supply the definitions of the user-defined types: CodeID,
RecordStatusID, RecordID, KeyForeign, DateTmCreated, and DateTimeRequired.
I suspect the problem is to be found there, or in a default attached to a
user defined type.
"Karolus" <Karolus@.discussions.microsoft.com> wrote in message
news:B32CFD3E-BF21-471D-8E32-F33B5E616DE1@.microsoft.com...
> Thanks, John, I got the document. Here is the table definition. (Thanks
for
> the advice.)
> CREATE TABLE [t_Answer] (
> [AnswerID] [CodeID] NOT NULL ,
> [AssessmentID] [CodeID] NOT NULL ,
> [QuestionID] [CodeID] NOT NULL ,
> [EvaluationValue] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [AnswerText] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [RecordStatusID] [RecordStatusID] NOT NULL ,
> [RecordID] [RecordID] IDENTITY (1, 1) NOT NULL ,
> [CreationUser_ID] [KeyForeign] NOT NULL ,
> [CreationDtm] [DateTmCreated] NOT NULL ,
> [RevisionUser_ID] [KeyForeign] NOT NULL ,
> [RevisionDtm] [DateTimeRequired] NOT NULL ,
> CONSTRAINT [COMMENTID] PRIMARY KEY CLUSTERED
> (
> [AnswerID],
> [AssessmentID],
> [QuestionID]
> ) ON [PRIMARY] ,
> CONSTRAINT [fk_Answer_AssessmentID_Assessment] FOREIGN KEY
> (
> [AssessmentID]
> ) REFERENCES [t_Assessment] (
> [AssessmentID]
> ),
> CONSTRAINT [fk_Answer_QuestionID_QuestionID] FOREIGN KEY
> (
> [QuestionID]
> ) REFERENCES [t_QuestionID] (
> [QuestionID]
> )
> ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
> GO
>
> I hope this information is helpful. I don't understand what I'm screwing
up.
> "John Bell" wrote:
>
post
EvaluationValue,
152 )
have two|||Hi Karolus,
I agree with John. You may need to check triggers entering values into
RevisionDtm and CreationDtm.
You have four not null fields for that you didn't provide values in
your insert statement,
so you may have triggers for them.
I hope it help you.
Kim|||Hi
CreationDtm and Revisiondtm are not nullable, but you have not supplied a
value in your statement, therefore you would get an error for that but
normally not the one you have stated, therefore I think you may have default
s
in the user defined types DateTimeRequired and DateTmCreated that are
incorrect.
John
"Karolus" wrote:
> Thanks, John, I got the document. Here is the table definition. (Thanks
for
> the advice.)
> CREATE TABLE [t_Answer] (
> [AnswerID] [CodeID] NOT NULL ,
> [AssessmentID] [CodeID] NOT NULL ,
> [QuestionID] [CodeID] NOT NULL ,
> [EvaluationValue] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [AnswerText] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [RecordStatusID] [RecordStatusID] NOT NULL ,
> [RecordID] [RecordID] IDENTITY (1, 1) NOT NULL ,
> [CreationUser_ID] [KeyForeign] NOT NULL ,
> [CreationDtm] [DateTmCreated] NOT NULL ,
> [RevisionUser_ID] [KeyForeign] NOT NULL ,
> [RevisionDtm] [DateTimeRequired] NOT NULL ,
> CONSTRAINT [COMMENTID] PRIMARY KEY CLUSTERED
> (
> [AnswerID],
> [AssessmentID],
> [QuestionID]
> ) ON [PRIMARY] ,
> CONSTRAINT [fk_Answer_AssessmentID_Assessment] FOREIGN KEY
> (
> [AssessmentID]
> ) REFERENCES [t_Assessment] (
> [AssessmentID]
> ),
> CONSTRAINT [fk_Answer_QuestionID_QuestionID] FOREIGN KEY
> (
> [QuestionID]
> ) REFERENCES [t_QuestionID] (
> [QuestionID]
> )
> ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
> GO
>
> I hope this information is helpful. I don't understand what I'm screwing
up.
> "John Bell" wrote:
>|||Thanks all for your help. I VERY much appreciate it. I've come for Sybase
and am overwhelmed by the difference. Here are the domain definitions and
the code that created the table, t_answers. I assumed that I should provide
a datetime, but that didn't work either...so I'm .
Here's the information:
/ *=======================================
=======================*/
/* Domain: DateTmCreated */
/ *=======================================
=======================*/
sp_addtype DateTmCreated, 'datetime' , 'not null'
go
/ *=======================================
=======================*/
/* Domain: DateTimeNotMandatory */
/ *=======================================
=======================*/
sp_addtype DateTimeNotMandatory, 'datetime'
go
/ *=======================================
=======================*/
/* Domain: DateTimeRequired */
/ *=======================================
=======================*/
sp_addtype DateTimeRequired, 'datetime' , 'not null'
go
create default D_DateTimeRequired
as 'CURRENT TIMESTAMP'
go
sp_bindefault D_DateTimeRequired, DateTimeRequired
go
/ *=======================================
=======================*/
/* Domain: DateTm */
/ *=======================================
=======================*/
sp_addtype DateTm, 'datetime'
go
create default D_DateTm
as 'CURRENT TIMESTAMP'
go
sp_bindefault D_DateTm, DateTm
go
/ *=======================================
=======================*/
/* Table : t_Answer */
/ *=======================================
=======================*/
create table t_Answer (
AnswerID CodeID not null,
AssessmentID CodeID not null,
QuestionID CodeID not null,
EvaluationValue text null,
AnswerText text null,
RecordStatusID RecordStatusID not null,
RecordID RecordID identity,
CreationUser_ID KeyForeign not null,
CreationDtm DateTmCreated not null,
RevisionUser_ID KeyForeign not null,
RevisionDtm DateTimeRequired not null,
constraint COMMENTID primary key (AnswerID, AssessmentID, QuestionID)
)
go
"John Bell" wrote:
> Hi
> CreationDtm and Revisiondtm are not nullable, but you have not supplied a
> value in your statement, therefore you would get an error for that but
> normally not the one you have stated, therefore I think you may have defau
lts
> in the user defined types DateTimeRequired and DateTmCreated that are
> incorrect.
> John
> "Karolus" wrote:
>|||Looks like the error is just the CREATE DEFAULT statements.
CURRENT_TIMESTAMP is a keyword and mustn't be quoted as a string:
CREATE DEFAULT D_DateTm
AS CURRENT_TIMESTAMP
David Portas
SQL Server MVP
--sql

cannot edit this cell

when I fetch recods via enterprise manager and try to insert new
record I get the following error
"cannot edit this cell" but when I use "query analyzer" using T-sql commands I can execute DML operations .

it seems that there is no problem in the permissions ,I can not understand what is the problem .

can any one please help me it is very urgent since the problem is in one
of our production databases.

note that I use sql server 2000Your description does not sound this complicated - but check out the following article:

article (http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q288969&)|||Maybe the cell in the column is defined as an Identity column?|||give the sp_help 'tablename' and see the owner of the table may be it is the owners name through whch ur not entering to the table .

Monday, March 19, 2012

cannot create multiple triggers

PLS HELP !!!!
I cannot create multiple triggers (AFTER) of command type INSERT. When
I create a new one the previous one gets deleted.
Prodcut: SQL Server Enterprise Edition.
Product Version:8.00.194 (TRM).
The funny thing is that this happens on clients production environment
while I am able to create multiple triggers on my development
environment. The properties for this sql servers is as follows
Product: SQL Server Enterprise Edition.
Production Version: 8.00.760 (SP3).
Is this because of different product version or am i missing something?Hi
Tell you client to apply at least SQL Server 20000 SP3a. They are totally
unpatched and susceptible to Slammer.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
<agandhi@.usc.edu> wrote in message
news:1121983311.188033.51980@.g47g2000cwa.googlegroups.com...
> PLS HELP !!!!
> I cannot create multiple triggers (AFTER) of command type INSERT. When
> I create a new one the previous one gets deleted.
> Prodcut: SQL Server Enterprise Edition.
> Product Version:8.00.194 (TRM).
> The funny thing is that this happens on clients production environment
> while I am able to create multiple triggers on my development
> environment. The properties for this sql servers is as follows
> Product: SQL Server Enterprise Edition.
> Production Version: 8.00.760 (SP3).
> Is this because of different product version or am i missing something?
>|||Thanks for the recommendation and I will do that immediately but any
idea about not being able to create multiple triggers.
Regards,|||Why SP3a and not SP4? SQL Server 2000 is installed on Windows 2000
Machine.|||The service pack may fix the problem you're having with creating multiple
triggers. If it works on the development server and not on the production
server, then it is probably the service pack. Unless the triggers are
instead of triggers, you can have more than one trigger of the same kind on
a table provided the name of the trigger is different for each one.
<agandhi@.usc.edu> wrote in message
news:1121985554.564111.259640@.g47g2000cwa.googlegroups.com...
> Thanks for the recommendation and I will do that immediately but any
> idea about not being able to create multiple triggers.
> Regards,
>|||agandhi@.usc.edu wrote:
> Why SP3a and not SP4? SQL Server 2000 is installed on Windows 2000
> Machine.
He said SP3a as a *minimum*. Whether they're ready to move up to SP4 or
not is more of a business decision, and less of a "we have a massive
security hole here" kind of thing.
Damien

Sunday, March 11, 2012

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?

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?

|||

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.

|||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|||Bill - is this thread closed or do you still need help? If this is closed out you can mark it as "answered". Thanks!|||sounds good, but i had the same problem and this didn't work for me.|||

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.

|||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?|||

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.?

|||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!|||

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

|||

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

|||Yes, this works. Ah, why isn't this fixed in SQL Server's updates?

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?

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?

|||

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.

|||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|||Bill - is this thread closed or do you still need help? If this is closed out you can mark it as "answered". Thanks!|||sounds good, but i had the same problem and this didn't work for me.|||

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.

|||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?|||

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.?

|||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!|||

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

|||

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

|||Yes, this works. Ah, why isn't this fixed in SQL Server's updates?

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?

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?

|||

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.

|||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|||Bill - is this thread closed or do you still need help? If this is closed out you can mark it as "answered". Thanks!|||sounds good, but i had the same problem and this didn't work for me.|||

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.

|||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?|||

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.?

|||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!|||

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

|||

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

|||Yes, this works. Ah, why isn't this fixed in SQL Server's updates?

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?

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?

|||

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.

|||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|||Bill - is this thread closed or do you still need help? If this is closed out you can mark it as "answered". Thanks!|||sounds good, but i had the same problem and this didn't work for me.|||

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.

|||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?|||

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.?

|||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!|||

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

|||

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

|||Yes, this works. Ah, why isn't this fixed in SQL Server's updates?

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?

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?

|||

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.

|||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|||Bill - is this thread closed or do you still need help? If this is closed out you can mark it as "answered". Thanks!|||sounds good, but i had the same problem and this didn't work for me.|||

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.

|||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?|||

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.?

|||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!|||

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

|||

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

|||Yes, this works. Ah, why isn't this fixed in SQL Server's updates?

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?

Did you encounter the same issue in all of the databases in the local SQL server? Or just particular database(s)? I guess the issue is caused by a database attached from previous SQL server (2000 or 7.0), if it does, please let me know.

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?

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?

|||

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.

|||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|||Bill - is this thread closed or do you still need help? If this is closed out you can mark it as "answered". Thanks!|||sounds good, but i had the same problem and this didn't work for me.|||

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.

|||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?|||

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.?

|||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!|||

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

|||

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

|||Yes, this works. Ah, why isn't this fixed in SQL Server's updates?

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?

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?

|||

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.

|||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|||Bill - is this thread closed or do you still need help? If this is closed out you can mark it as "answered". Thanks!|||sounds good, but i had the same problem and this didn't work for me.|||

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.

|||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?|||

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.?

|||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!|||

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

|||

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

|||Yes, this works. Ah, why isn't this fixed in SQL Server's updates?

Thursday, March 8, 2012

Cannot create a row of size %d which is greater than the allowable maximum of %d

I'm trying to execute an insert with a PreparedStatement object and I am getting the following Error message:

java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot create a row of size 8320 which is greater than the allowable maximum of 8060.

Does anyone have a solution for this?You're inserting data that is larger than the maximum page size for SQL Server. See this page (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/trblsql/tr_reslsyserr_1_20hd.asp).|||Originally posted by Mulligan
You're inserting data that is larger than the maximum page size for SQL Server. See this page (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/trblsql/tr_reslsyserr_1_20hd.asp).

Thanks for the link. I had already taken a look there before finding this forum but I couldn't understand why my data was longer than the page size for SQL because I was only inserting a small amount of data.

I found that my problem due to MS SQL creating a temporary table based on my Insert Statement using the table definition for the size of the columns. In this case, I had a nvarchar(4000) column. This then generated a temp table with a column size equivalent to 8363 bytes but the page size is 8060. This happens even though the data I was inserting was much smaller than the max length.

To resolve the problem I had to reduce to the column size to a maximum of 3868. This resolved the problem.|||Nice bit of detective work. And thanks for posting back with the solution - it makes a refreshing change from all the "How can I fix problem X?" "Like this." "Bye" postings :)

Mull.