2
Answers

How to solve same id problem?

Harshal Thakre

Harshal Thakre

10y
883
1

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...
------------

Answers (2)