Arjan's World: SQL Server 2000: Use SCOPE_IDENTITY() Instead Of @@IDENTITY
You are now being redirected to the new housing of Arjan's World. Click here in case nothing happens

Monday, August 22, 2005

SQL Server 2000: Use SCOPE_IDENTITY() Instead Of @@IDENTITY

As I'm not working with SQL Server the whole day, my knowledge about the platform is not extensive. I was alway under the impression that using SQL Server 2000, you can get the identity value of the last inserted row by issuing a SELECT @@identity. Apparently, it is not according to the following article
Check Your SQL Server Identity: Since SQL Server 2000 you have to use SCOPE_IDENTITY() instead, as the former could give unexpected results.

When you work with SQL Server and don't know this SQL Server Central, check it out as it contains a lot of interesting articles

0 Comments:

Post a Comment

<< Home