John A Grandy (johnagrandy-at-gmail-dot-com) writes:
Quote:
Via sql , I created a unique constraint on my table , but in SSMS it
doesn't show up in the Constraints list but rather in the Indexes list.
I know that Sql Server internally implements unique constraints as
indexes , but why won't it show up in the SSMS Constraints list ? Is
that list for default constraints only ? |
And CHECK constraints.
But not PRIMARY KEY, UNIQUE or FOREIGN KEY constraints. All these are
however in the Keys node. And, as you noted, PK and UNIQUE constraints
also show up in the Indexes node.
I'm not going to try do defend this listing. It could make sense to
collapse the Keys and Constraint nodes into one, possibly with subnodes
for the different types of constraints. It could also make sense to rename
Constraints to "CHECK Constraints", and don't include defaults here at all,
but only with the columns. (While they are implemented with the CONSTRAINT
syntax, defaults are not constraints from a logical point of view.)
--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx