Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 29th, 2005, 04:06 PM
Registered User
 
Join Date: Dec 2005
Location: New Market, MD, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Navy1991
Default Identity Property issue

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.

 
Old December 29th, 2005, 04:41 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

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

 
Old January 6th, 2006, 05:27 AM
Friend of Wrox
 
Join Date: Sep 2004
Location: New Delhi, Dekhi, India.
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Anantsharma Send a message via Yahoo to Anantsharma
Default

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




Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing off the Identity Property happygv SQL Server 2000 17 September 10th, 2007 07:38 AM
dropping the identity property of column sandeep SQL Server 2005 3 March 2nd, 2007 01:57 PM
What is @@identity property? subhashbankey SQL Server 2000 2 December 22nd, 2005 09:01 PM
Identity Column Issue mepancha SQL Server 2000 5 June 17th, 2005 03:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.