Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL trigger to avoid real time registration errors Expand / Collapse
Author
Message
Posted Wednesday, September 1, 2010 10:40 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 4, 2010 6:47 PM
Points: 5, Visits: 30
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?
Post #979284
Posted Wednesday, September 1, 2010 11:25 PM


SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Yesterday @ 9:05 PM
Points: 94, Visits: 395
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!
Post #979295
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse