Which should i use to get last inserted record id in sql server 2005?
I searched stackoverflow and i found this,
SQL: How to get the id of values I just INSERTed
Using @@identity is reliant on the fact that there are no triggers in your database creating records elsewhere.
@@identity
If you create a record but a trigger then creates a log entry for the creation, @@identity will return you the id of the log entry in the log table.