November 19, 2008 at 8:27 am
Hello All,
Is it possible to change a column (ON UPDATE Action to CASCADE from NO ACTION in SQL 2005?
If yes could someone please share an example code for that?
Thanks
November 20, 2008 at 3:53 am
can you be more clear? I don't understand what you want.
If you need to change an update/insert statement you can use an INSTEAD OF trigger (see BOL for explanation).
November 20, 2008 at 8:32 am
I believe you are asking if you can change the on UPDATE action for a foreign key constraint. You need to drop the constraint and then re-add with the change.
ALTER TABLE table_name
DROP CONSTRAINT FK_Name
Go
ALTER TABLE table_name WITH NOCHECK ADD CONSTRAINT
FK_name FOREIGN KEY
(
column_name
) REFERENCES fk_table_name(
column_name
) ON UPDATE CASCADE
ON DELETE NO ACTION
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply