IF at the same time 2 user call this procedure snippet....
@idnumber bigint,
@name varchar(50)
declare @id bigint=(select MAX(IdNumber)+1 from PersonalDetail)
insert into taba values(@id,@name)
------------------------------------
Note:Id Number is pk.
---------------------------
plz tell me what will happen....
1.Either first user record insert or second.
2.Both will show error.
3.this is not good way to handle such type of problem.
4.No Need to worry both record will insert with diffrent id.
5.Anything else.
------------------
Plz tell me how to solve...
------------
Loading

Riyaz AkhtarPosted Aug 25, 2014, 3:54 AM
Abhineet SrivastavaPosted Aug 25, 2014, 3:33 AM
Like
If Exist(select 1 from table where id=@id)
{
return;
}