Reputation: 37633
I would like to see some example how to modify foreign key relationship in TSQL because it is missing here http://technet.microsoft.com/en-us/library/ms175493.aspx
Actually I want to apply delete rule Cascade.
Should it be like?
ALTER TABLE Email MODIFY
CONSTRAINT FK_EmailContact_Email
ON DELETE CASCADE
Thank you!
Upvotes: 5
Views: 9847
Reputation: 37633
I found how I can do it
GO
ALTER TABLE EmailContact DROP
CONSTRAINT FK_EmailContact_Email
GO
ALTER TABLE EmailContact ADD
CONSTRAINT FK_EmailContact_Email
FOREIGN KEY (EmailId)
REFERENCES Email (Id)
ON DELETE CASCADE
Upvotes: 13