Group: Forum Members
Posts: 2K,
Visits: 6.6K
|
I'm wondering what the best practice is (or the trade offs are) for handling duplicates in a unique index. My pks are 99.9% auto increment integers, so that is never a problem, but I often have a unique index on one or two other fields or combination of fields. What is the preferred method to handle possible duplicates? I have thought of two methods:
- catch the sql exception and notify the user
- check the db first to see if the data would cause a duplicate, using BO methods.
What are you all doing? Why?
Thanks!
|