This topic is locked
[SOLVED]

 column does not allow nulls. INSERT fails.

1/6/2005 3:07:36 AM
ASPRunnerPro General questions
W
Webspin author

I am receiving the an error when trying to insert a record in an MSSQL Database. I built the database using Enterprise Manager. I am using an id field defined as int for the primary key.
-2147217900

Error description [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'id', table 'PowerMax.dbo.tbl_PMCordlessDetailEnglish'; column does not allow nulls. INSERT fails.

SQL query insert into [dbo].[tbl_PMCordlessDetailEnglish] (Prod1Head1, Prod1Content1, Prod1Head2, Prod1L1, Prod1L2) values ('jadfvuaduh', '', '', '', '')
Any help with this will be appreciated. I am using ASP Runner build 3.1a
Thank you

Rick Sweeney

Webspin Graphics and Web Design

W
Webspin author 1/6/2005

I figured this out. Using Enterprise Manager; when you define an ID Field (Primary Key Field), you need to set the Identity to "Yes", Identity seed to 1 and Identity increment to 1.
Hope this helps a few of you who may run accross this.
Rick Sweeney

Webspin Graphics and Web Design

D
d_amboy 10/2/2009

Your answer helped me....thank you for posting <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=44428&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />