locked
SysIndex - difference b/w is_unique and is_unique_constraint RRS feed

  • Question

  • runing a select query on SQL Server 2008, sys.indexes gives me information on the index define for a database .

    There 2 fields is_unique and is_unique_constraint. I dont understand the difference b/w them .


    Huzaifa
    Thursday, August 19, 2010 10:50 AM

Answers

  • An index which one way or the other is a unique index will have 1 for the is_unique column.

    An index might have been defined with a Primary Key constraint, and such index will also have 1 in the is_primary_key column.

    An index might have been defined with a Unique constraint, and such index will also have 1 in the is_unique_constraint column.

    Check out http://msdn.microsoft.com/en-us/library/ms190765.aspx for more information about constraints.


    Tibor Karaszi, SQL Server MVP | http://www.karaszi.com/sqlserver/default.asp | http://sqlblog.com/blogs/tibor_karaszi
    Thursday, August 19, 2010 11:01 AM