Wednesday, July 27, 2011

SQL Server Alter Table Modify constraint......


The answer for this problem would be in two steps.
1. First drop the constraint.
2. Add the new constraint with ON DELTE CASCADE option.

Ex:
ALTER TABLE E_2
DROP CONSTRAINT R_1
go


ALTER TABLE E_2
ADD CONSTRAINT R_1 FOREIGN KEY (a) REFERENCES E_1(a)
ON DELETE CASCADE
ON UPDATE NO ACTION
go


No comments:

Post a Comment