Is there a way to stop duplicate entries into a database from people double clicking the submit button?You can use UNIQUE CONSTRAINTS for all columns not participating in a primary key.
See "Unique constraints" in BOL
Originally posted by rob7765
Is there a way to stop duplicate entries into a database from people double clicking the submit button?|||Although this could be handled on the DB side, I feel it's more appropriatly handled on the web-server side. Simplest is JS that disables a double-submit (Darn those mainframe people and their double-enter habbits).
For situations where you 100% of the time can't have double-submits, consider setting a hidden field & session variable that tracks if the user has submittted the form or not.
There is much discussion of this in forms dealing with the web side of life.
Showing posts with label entries. Show all posts
Showing posts with label entries. Show all posts
Friday, March 9, 2012
multiple submit
Is there a way to stop duplicate entries into a database from people double clicking the submit button?1. Beat them about the head and shoulders every time you catch them double clicking.
2. Put a unique index on the key column(s).
3. Add a trigger to prohibit inserting duplicate rows. Don't forget to have a nasty message!
4. Only allow modifications via stored procedures. By using a stored procedure you can do cool things like link to the payroll system and transfer $3.00 from their paycheck to yours everytime the double click.
5. Re-write your application so double clicks won't be a problem.|||I just posted a reply to a similar message. It was as general as, but as not witty as, Paul's response. I recomended solving it on the web side.
2. Put a unique index on the key column(s).
3. Add a trigger to prohibit inserting duplicate rows. Don't forget to have a nasty message!
4. Only allow modifications via stored procedures. By using a stored procedure you can do cool things like link to the payroll system and transfer $3.00 from their paycheck to yours everytime the double click.
5. Re-write your application so double clicks won't be a problem.|||I just posted a reply to a similar message. It was as general as, but as not witty as, Paul's response. I recomended solving it on the web side.
Subscribe to:
Posts (Atom)