Friday, February 4, 2011

Modify an existing constraint

Modify an existing constraint requires next steps
- drop the existing constraint


ALTER TABLE [dbo].[tblA] 
DROP FK_tblA_a

-adding this constraint again 


ALTER TABLE [dbo].[tblA]  WITH CHECK ADD  CONSTRAINT [FK_tblA_a] FOREIGN KEY([IdCol])
REFERENCES [dbo].[tblB] ([ID])
ON UPDATE CASCADE
ON DELETE CASCADE

No comments:

Post a Comment