[thelist] connection-specific @@IDENTITY

Judah McAuley judah at alphashop.com
Wed May 16 13:52:02 CDT 2001

OK.  I know that this has been discussed on the list before, but I could 
only find minimal reference in thelist archives, so I'm going to ask again.

It was established before that @@IDENTITY (in MS SQL server) is global in 
nature.  If you are not within a transaction, you do an insert, someone 
else does an insert, and you select @@IDENTITY you will get the value from 
the most recent insert, not the value from your connection.  If I recall 
correctly, there was an alternative strategy that allowed you to retrieve 
the connection-specific insertion without resorting to single-threading the 
db.  Am I remembering correctly?  Am I full of it?

I know that you can do it in MySQL, but I think it can also be done in 
MSSQL.  Any thoughts?


More information about the thelist mailing list