Posted by Susanne Klemm on 03/20/06 14:27
Hi!
I have a table with a check constraint. But unfortunately it does not
work like I wanted.
CREATE TABLE MAP
(
[R_ID] [T_D_ID] NOT NULL,
[R_ID1] [T_D_ID] NULL,
CONSTRAINT CHECK_ID1 CHECK (R_ID1 = R_ID OR R_ID1 = NULL),
CONSTRAINT [PK_MAP] PRIMARY KEY ([R_ID])
)
R_ID1 should always have the value of R_ID or Null
The following statements should cause errors:
insert into map (R_ID, R_ID1)values(1,2);
update map set R_ID1=3 where R_ID=1;
But there occur no errors. Does anyone have an idea? It is an SQL Server
2000.
TIA
Susanne
[Back to original message]
|