Subject: Identity Property issue
Posted By: Navy1991 Post Date: 12/29/2005 3:06:22 PM
I have created a simple table in SQL 2000 and have two fields.  I have created an primary key field with an int with the Identity to Yes/Identity Seed 1/Identity Increment 1.  However, when I go out to the default.cfm page it does not increment by 1?  I get the following error.  I appreciate any help with this issue.  Thank you in advance!!!

[Macromedia][SQLServer JDBC Driver][SQLServer]Cannot insert explicit value for identity column in table 'Med_IDX_Signoff_Acceptance' when IDENTITY_INSERT is set to OFF.

Reply By: jbenson001 Reply Date: 12/29/2005 3:41:05 PM
It looks like you are trying to explicitly insert an value in the identity column.  Liek the error says you can't do that unless Idenity_Insert is on.  I don't reccomend that.

Jim

Reply By: Anantsharma Reply Date: 1/6/2006 4:27:39 AM
HI frnd,

Sounds you are Logging/recording login and Logoffs from yuor web page/app. If you already defined a column to be Identity, you should not specify any value for that column. Just pass the value for Scond column using Insert statement OR your ADO/ADO.NET code. SQL will take care of the column with Identity. However, if you want a value of your choice to be put into column, you Must tell SQL to SET IDENTITY INSERT ON.

Hope this helps.

B. Anant

Go to topic 38275

Return to index page 402
Return to index page 401
Return to index page 400
Return to index page 399
Return to index page 398
Return to index page 397
Return to index page 396
Return to index page 395
Return to index page 394
Return to index page 393