How to avoid duplicate insert during concurrent users in sqlHi,
I have a web application developed in asp.net & SQL. During insert by concurrent users duplicate refno records are getting generated. I tried getting the Max(ID) also checked the exists, but when the procedure is executed concurrently the refnos are getting generated with the same no. but different id.
Please advice whether I have to use any lock while inserting the records in sql.