To get the last identity, there is a statement:
Select @@identity
More complete information for this is in the SQL Reference manual.