unique constraint with unique index

  • I have a non clustered unique constraint defined on the table let's say on columns 1, 2, 3.

    Lots of queries would benefit if I add 1 more column in INCLUDE to cover queries but since unique constraint can't have INCLUDE clause I would like to drop unique constraint and recreate as a unique index with INCLUDE clause.

    But I want to make sure that by adding INCLUDE clause it will not affect the uniqueness of the columns 1, 2 and 3.

    Can you please verify if I am thinking correctly?

  • You are correct. That should do what you need.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 2 posts - 1 through 1 (of 1 total)

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