Unique Constraint converting to Index

  • I can't figure this out... It looks like some unique constraints I had defined have automagically converted to Unique Indexes.  I know, there isn't really much difference between these two, but it is polluting my database structure comparison reports with differences I don't want to see.  Does anybody know of a situation where a Unique Constraint could be converted to an Index implicitly?  I'm wondering about the Optimization Job in the database maintenance plan that is set to leave 10% free.  Any chance that this would cause my constraint to be recreated as an index?  I'm having trouble testing that theory, and I may be way off track here, but thought I'd throw it out to you all for feedback.
     
    Thanks!
     
  • I have never heard of this happening.

    Have you considered the possibility of human error?

     

     

     

  • Error??!  ME????  How dare you!    Actually, I'm beginning to think that was the cause.  Thanks for the honest answer!
     
  • When you create a unique constraint, a unique index is created to enforce it.

    -Eddie

     

    Eddie Wuerch
    MCM: SQL

  • You can observe that the query compiler will use a constraint as it would an index.  As pointed out above, a UQ is enforced by creating an index.  If you script out the table, and the constraint  is somehow changed to a create index, why then we have a problem.

    Think of it as a free lunch!

     

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

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