IDENTITY (MSSQL 6.5) - Primary Key violation 
Author Message
 IDENTITY (MSSQL 6.5) - Primary Key violation
I am having a problem with a IDENTITY column which is the primary key on a
table.  The value of the primary key is always generated by SQLServer, yet
when I call the stored procedure, which is inserting into the table a
Primary Key violation is being generated.  I have doubled the Open objects
(5000 to 10000) but still have the problem.

Is there a bug with IDENTITY in version 6.5 (SP4).

Or even is there a reliable way on generating a unique value for a primary
key!

CSKIP



Sun, 22 Jul 2001 03:00:00 GMT
 IDENTITY (MSSQL 6.5) - Primary Key violation

If generating unique keys (possibly among replicated sites) you migh want to
try GUID keys. They can be generated by applications without database
interaction. It costs some extra bytes (depending on how you store them, a
GUID takes at least 128-bits of storage) but it saves you a lot of trouble
generating keys.

Silvio Bierman

Quote:

>I am having a problem with a IDENTITY column which is the primary key on a
>table.  The value of the primary key is always generated by SQLServer, yet
>when I call the stored procedure, which is inserting into the table a
>Primary Key violation is being generated.  I have doubled the Open objects
>(5000 to 10000) but still have the problem.

>Is there a bug with IDENTITY in version 6.5 (SP4).

>Or even is there a reliable way on generating a unique value for a primary
>key!

>CSKIP



Mon, 23 Jul 2001 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. INSERT INTO TABLE KEYED ONLY ON IDENTITY COLUMN RESULTS IN KEY VIOLATION (6.5)

2. SQL Server 6.5 Violation of PRIMARY KEY

3. Primary Key Violations (SQL 6.5)

4. SQL 6.5 MSDB Violation of Primary Key pk_backup_id

5. Violation of PRIMARY KEY constraint with identity!

6. Primary Key Violation - Identity PK

7. Primary Key Violations on IDENTITY column

8. Violation of PRIMARY KEY on identity col

9. On Insert with IDENTITY, I get Msg 2627 Violation of PRIMARY KEY constraint

10. violation of primary key on identity column

11. violation of primary key on identity column


 
Powered by phpBB® Forum Software