Best Practice to Check for Duplicates


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
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!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search