SQL Server/T-SQL Tutorial/System Tables Views/sysconstraints — различия между версиями

Материал из SQL эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Текущая версия на 13:24, 26 мая 2010

The system table sysconstraints contains one row for every integrity constraint that is defined for a database object using the CREATE TABLE or ALTER TABLE statement.

   <source lang="sql">

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)</source>