default constraints. | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

default constraints.

does anyone know why the INFORMATION_SCHEMA.TABLE_CONSTRAINTS view doesn’t return default constraints? I look at the source and the value to select the default constraint isn’t part of the query…. Just wondering why these are the only constraints returned.. –snippet from view
when ‘C’ then’CHECK’
when ‘UQ’ then’UNIQUE’
when ‘PK’ then’PRIMARY KEY’
when ‘F’ then’FOREIGN KEY’
SELECT cols.name, col.name ,tab.name FROM sysobjects tab, sysobjects col, syscolumns cols
WHERE cols.id = tab.id AND col.id = cols.cdefault AND col.xtype = ‘D’ Madhivanan Failing to plan is Planning to fail
I guess there is no real reason for this, The INFORMATION_SCHEMA Views in SQL Server 2000 are not optimal. I’ve heard that this has improved in SQL Server 2005 —
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Heute schon gebloggt?http://www.insidesql.de/blogs
Ich unterstütze PASS Deutschland e.V. http://www.sqlpass.de)

]]>