Hi all
i've executed the following
CREATE DATABASE practise
USE practise
CREATE TABLE dbo.SUPPLY1 (
supplyID INT CONSTRAINT SUPPLY1_pk PRIMARY KEY CONSTRAINT SUPPLY1_chk CHECK (supplyID BETWEEN 1 and 150),
supplier CHAR(50)
);
SELECT unique_index_id, is_system_named, * FROM sys.key_constraints WHERE name=N'SUPPLY1_pk'
AND SCHEMA_NAME(schema_id)='dbo'
SELECT name, parent_column_id, definition, is_system_named, * FROM sys.default_constraints WHERE name=N'SUPPLY1_chk'
EXEC sp_help @objname='SUPPLY1'
but what is suprising is when I execute
SELECT name, parent_column_id, definition, is_system_named, * FROM sys.default_constraints
There's not even SUPPLY1_chk being mentioned.
while I understand there's bugs associate with sys.default_constraints from http://qa.sqlservercentral.com/Forums/Topic1359991-3077-1.aspx
the situation above is different as it is a permanent table
if I execute
EXEC sp_help @objname='SUPPLY1'
......
CHECK on column supplyID SUPPLY1_chk (n/a) (n/a) Enabled Is_For_Replication ([supplyID]>=(1) AND [supplyID]<=(150))
PRIMARY KEY (clustered) SUPPLY1_pk (n/a) (n/a) (n/a) (n/a) supplyID
SUPPLY1_chk appears in the list
Am I missing something here?
thanks!