![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hi Michael, We should use NOCHECK instead of UNCHECKED when altering a existing constraint to be invalid. I made a sample on my side with DTS and it works. CREATE TABLE Test2 ( TID INT Primary KEY, CID INT IDENTITY(1,1) UNIQUE ) INSERT Test2 VALUES (11) INSERT Test2 VALUES (12) INSERT Test2 VALUES (13) INSERT Test2 VALUES (14) --SELECT * FROM Test2 CREATE TABLE Test2Child ( TCID INT FOREIGN KEY REFERENCES Test2(CID), TC CHAR(1) ) INSERT Test2Child VALUES (55,'B') --The statement above will fail ALTER TABLE Test2Child NOCHECK CONSTRAINT FK__Test2Child__TCID__48CFD27E INSERT Test2Child VALUES (55,'B') --The statement above will do since we have altered NOCHECK --Use a DTS package to do the test, it also works NOTE that if you have specified NOCHECK for the constraint, it will not check the constraints any more. Sincerely yours, Michael Cheng Microsoft Online Partner Support When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== === This posting is provided "AS IS" with no warranties, and confers no rights. |
#4
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |