Mega Code Archive

 
Categories / MSSQL Tutorial / System Tables Views
 

The system table sysconstraints contains one row for every integrity constraint that is defined for a database object

status  The type of the integrity constraint: 1 = PRIMARY KEY constraint; 2 = UNIQUE KEY constraint; 3 = FOREIGN KEY constraint; 4 = CHECK constraint; 5 = DEFAULT constraint; 16 = column-level constraint; 32 = table-level constraint 7> 8> 9> select  top 10 * from sysconstraints; 10> GO constid     id          colid  spare1 status      actions     error ----------- ----------- ------ ------ ----------- ----------- -----------  1131151075  1115151018      6      0      133141        4096           0 (1 rows affected)