Suppose I have a table called "Languages" with two fields. One field is an Identity field that acts as the Primary Key. The second field is "LanguageName" which would naturally be "English", "Spanish", etc. What I want to do is put a constraint on the LanguageName field so that someone cannot enter the same name twice.
Is it better to create an Index --> Create UNIQUE and use:
b) Index with Ignore duplicate key checked?
Is there any benefit of one over the other for my purpose? Thanks.
Retired Moderator at Xtreme VB Talk, for all of your Visual Basic needs.
I'd use a constraint because it better reflects what your intentions for that field are. An index will do the job of course but and index is more of an implementation thing than a data/business rule thing.