Mark writes: "I was asked a question today by a developer having problems getting the right identity value from @@identity when a table has a trigger which has an additional insert - Post the insert statement the select @@identity returns the wrong value (which is behaviour I would expect).
Is there a trick to get round this, apart from not using triggers and/or not using identity columns - which is what I suggested ..."
Prior to SQL Server 2000, the answer was "no". However, SQL Server 2000 adds two cool new functions to help you get around this problem. Read on...
It's nice to see your article, I have another question, can I get the last result regarding to the specified table and only on my connection? cause I have a table, I wanna know the last identity I have inserted, it sounds no way to do that.