@@ identity is unsafe. If the table has a trigger with an insert in the differnt table with an identifier, which is the value to be returned. Never use it to get the value of the inactivity you just inserted. You might think that I donβt have a trigger right now, but you never know when it can be added, and you can wait a long time before realizing that your data is hopelessly mixed up.