SQL6.5 - @@Identity Returns Incorrect Values

SQL6.5 - @@Identity Returns Incorrect Values

Post by Toby Geffrye » Thu, 16 Sep 1999 04:00:00



Can anyone help?


variable after an insert it constantly returns the wrong value

eg I get 17640 instead of 1.

The right value is inserted into the table but causes problems with FK
constraints

I have tried:-
1. DBCC CheckIdent.
2. Truncating the table (with and without checkpointing)
3. Dropping and recreating the table
4. Stopping & starting the Server

All with no success.

Thanks

Toby

 
 
 

SQL6.5 - @@Identity Returns Incorrect Values

Post by Stephen Robinso » Thu, 16 Sep 1999 04:00:00


Toby,

I know this is a long shot but you dont happen to have any triggers on this
tablke which in turn does another insert into a table also with an identity
field do you - if so it will pick you the last identity inser (is the

I hope this was of use.

Stephen Robinson (SQL MVP)


>Can anyone help?


>variable after an insert it constantly returns the wrong value

>eg I get 17640 instead of 1.

>The right value is inserted into the table but causes problems with FK
>constraints

>I have tried:-
>1. DBCC CheckIdent.
>2. Truncating the table (with and without checkpointing)
>3. Dropping and recreating the table
>4. Stopping & starting the Server

>All with no success.

>Thanks

>Toby


 
 
 

1. @@IDENTITY returning incorrect value

Hello All,



'return' is used to return the error code ).

All the procedures are working fine.. except for one which always returns a
value 2 greater than the actual identity of the row inserted.

e.g. if the procedure returns 82.. the actual identity for the row inserted

identity is 83.

What could be the cause and how do i correct this behavior??

thanx

2. DCS Dublin Still Has Job Opportunities !!!!

3. BUG: SQL6; Identity property returns NULL

4. MultiMedia Database/Library WANTED.

5. Incorrect Identity value

6. oracle context vs pc docs

7. SQL Web Assistant

8. OLE DB provider MSDASQL returned an incorrect value for DBPROP_CONCATNULLBEHAVIOR w/ OPENROWSET

9. OLE DB provider MSDASQL returned an incorrect value for DBPROP_CONCATNULLBEHAVIOR

10. ODBC returns incorrect value in stored procedure

11. ODBC call stored procedure returns incorrect value

12. ODBC return incorrect value