Also note that SELECT @IDENTITY is per connection, so if you do multiple insertions on the same connection, just the last identity is returned.