-
@@IDENTITY
I have a table (tblMoney). When I insert a new row into the table, via a standard insert stored procedure, the new row, has the identity column numbered correctly (say 34 for example). At the end of the stored procedure, we return @@IDENTITY for the developers. This will return a much bigger number (1198).
Any idea how these got out of sync, or how they can be fixed??
Thanks!
Trisha
-
@@IDENTITY (reply)
DBCC CHECKIDENT
------------
Trisha at 3/9/01 4:27:24 PM
I have a table (tblMoney). When I insert a new row into the table, via a standard insert stored procedure, the new row, has the identity column numbered correctly (say 34 for example). At the end of the stored procedure, we return @@IDENTITY for the developers. This will return a much bigger number (1198).
Any idea how these got out of sync, or how they can be fixed??
Thanks!
Trisha
-
@@IDENTITY (reply)
Hi
Your SP isn't modifying any other tables? @@IDENTITY will return the LAST update done by this connection ...
Dale
-
@@IDENTITY (reply)
Does this imply that if you have and Insert that causes a trigger there is no way to capture the identity value of the Insert (assuming the trigger add a record to a table with an identity of course)?
Is there a workaround?, Best Practice?
Regards,
Peter
------------
Dale Shaw at 3/9/01 5:31:36 PM
Hi
Your SP isn't modifying any other tables? @@IDENTITY will return the LAST update done by this connection ...
Dale
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|