i have a procedure in which i am inserting record in employee table.nad getting empid by using @@identity ? when this procedure will be called by more than one user at same time,there can be possibility that it returns identity of some other employee inserted at same time.because there is no lock on identity by system?
--code
--identity on for empid column
insert into employee (name) values ('sahil');
return @@identity
refer http://stackoverflow.com/questions/882460/sql-server-2005is-it-safe-to-use-identity for lock on identity issue