SQL trigger to avoid real time registration errors

  • hi all,

    i have create a form(web app) to register customer details with "Submit" button.Once i click button "New" the registration form

    will appear with new generated Account Number.after fill form click submit to save into SQL server database..

    While one customer register his details another customer from other place Click button "New" to make registration.

    so same Account Number will generated and build problem when both click "Submit" button at same time.

    how could i prevent this problem ?

    if i use locking method to lock Account Number when click "New". Is this possible?

  • Hi there,

    As i understand, this happens because Account Number is already displayed while the record is not yet saved.. I'm just going to suggest solution to avoid this problem.. 😛

    Instead of displaying it immediately, you can put the word "Auto-generated". Then, after saving the record, you can display the generated Account Number..

    I disagree with locking method when clicking "New" since only one user at a time would be able to fill up their information.. Furthermore, it would also take time completing the information before they save the record..

    I hope this helps.. 🙂

    Welcome to sqlservercentral!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply