Restricting Duplicate description values

  • Hello gurus

    I ahve many tables in which there is a description field and I want to restrict duplicate values.

    Would it be better to have a unique constraint in description field also (Will it affect the performance of queries)

    or

    check it from the front end.

     

  • check in the front end AND apply unique constraint. Won't affect performance unless you have 1000s insert per hour/day. Also data integrity outweight performance in any case.

  • But is it advisable to keep a Unique constraint on the description field. Is it a general practise.

    This can be applied to all Master tables.

    Have u done such a thing

  • If you are referring to a lookup table then, most of the time (just not to say always), there's a unique constraint on the description column. However there might have some cases where you have another type in that table so you might have multiple fields in that constraint. But I personally have a unique constraint on 100% of those tables.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply