none
Is the a relationship between Unique Constraint and Unique Index ?? pls explain both . :)

Answers

  • There is no difference between Unique Index and Unique Constraint.

     

     

    You can use UNIQUE constraints to make sure that no duplicate values are entered in specific columns that do not participate in a primary key. Although both a UNIQUE constraint and a PRIMARY KEY constraint enforce uniqueness, use a UNIQUE constraint instead of a PRIMARY KEY constraint when you want to enforce the uniqueness of a column, or combination of columns, that is not the primary key.

    Multiple UNIQUE constraints can be defined on a table, whereas only one PRIMARY KEY constraint can be defined on a table.

    Unique Index (Primary Key Index)  are keep combination of columns across all rows of a table unique and makes a index on those columns and stores the Indexed data. It is a physical storage in Index tables while constraint is a rule.

     

    For more http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/

    Thursday, October 16, 2008 4:26 PM
  • In so far as creating a unique constraint automatically creates a unique index to enforce the uniqueness.

     

    Read more in Books Online:

     

    http://msdn.microsoft.com/en-us/library/ms187019(SQL.90).aspx

     

    HTH!

     

    Thursday, October 16, 2008 4:28 PM
    Moderator

All replies

  • There is no difference between Unique Index and Unique Constraint.

     

     

    You can use UNIQUE constraints to make sure that no duplicate values are entered in specific columns that do not participate in a primary key. Although both a UNIQUE constraint and a PRIMARY KEY constraint enforce uniqueness, use a UNIQUE constraint instead of a PRIMARY KEY constraint when you want to enforce the uniqueness of a column, or combination of columns, that is not the primary key.

    Multiple UNIQUE constraints can be defined on a table, whereas only one PRIMARY KEY constraint can be defined on a table.

    Unique Index (Primary Key Index)  are keep combination of columns across all rows of a table unique and makes a index on those columns and stores the Indexed data. It is a physical storage in Index tables while constraint is a rule.

     

    For more http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/

    Thursday, October 16, 2008 4:26 PM
  • In so far as creating a unique constraint automatically creates a unique index to enforce the uniqueness.

     

    Read more in Books Online:

     

    http://msdn.microsoft.com/en-us/library/ms187019(SQL.90).aspx

     

    HTH!

     

    Thursday, October 16, 2008 4:28 PM
    Moderator