TravisL explains why we should use scope_identity instead of @@identity when we want to get the ID of the last record that was added.
Use scope_identity() instead of @@identity
TravisL explains why we should use scope_identity instead of @@identity when we want to get the ID of the last record that was added.