This is a prety interesting topic as I find myself using @@identity ALL THE TIME !!!
If I understand well, what you mean is that if you use @@identity after inserting a row in a table (let say the new indentity created has the value 50) but a trigger as fired for that table, the trigger might create an other row in an other table which might generate an other identity value let say 480.
Which would mean that select @@identity would return 480 instead of 50?
If so how should i do to retrieve the correct identity? Or should i never used identity fields?
Thank you,
Francois
If I understand well, what you mean is that if you use @@identity after inserting a row in a table (let say the new indentity created has the value 50) but a trigger as fired for that table, the trigger might create an other row in an other table which might generate an other identity value let say 480.
Which would mean that select @@identity would return 480 instead of 50?
If so how should i do to retrieve the correct identity? Or should i never used identity fields?
Thank you,
Francois

Leave a comment