switched from @@identity to scope_identity() for inserts, because of triggers

If a table being inserted into has an AFTER INSERT trigger that itself does some inserts, the @@identity variable will return the ID inserted by the trigger. The newer scope_identity() function limits the scope of IDs to user's code only.