Re: select @@IDENTITY from MyTable

From: Vishal Parkar (REMOVE_THIS_vgparkar_at_yahoo.co.in)
Date: 03/10/04


Date: Wed, 10 Mar 2004 09:08:53 +0530

hi matt,

@@identity function will return the "last inserted" identity value in the table. ideally it
will be equal to the total number of rows in the table(assuming you do not have any gaps in
the sequence of identity values.)

If you want to know how many rows that have been inserted by the insert statement you will
have to make use of function @@rowcount.

Ex:

-- 
Vishal Parkar
vgparkar@yahoo.co.in


Relevant Pages