by biot · 14y ago · 0 comments
They never admitted it, but I'm 100% sure that the issue was that (in SQL Server) they were doing:
select @@identity
Rather than the correct call of: select scope_identity()
The former retrieves the identity of the latest record entered into the table regardless of what SQL statement produced the record (such as another user connecting to the database from a different connection thread); the latter retrieves the identity of the record entered from the current session.I thought that the difference had to do with what's returned if a trigger does an insert or something like that...
More fun @ http://msdn.microsoft.com/en-us/library/ms187342.aspx