ilya2 Posted August 4, 2004 Posted August 4, 2004 Hi, is it possible to create a nullifying cascade action in SQL Server 2000? I mean, if I delete a row from a master table, the references to that row in a detail table are turned to NULL. I was thinking it was a standard feature in SQL, but in MS SQL I could not find anything else than ON DELETE CASCADE, which causes child row deletion. Thanks Quote Ilya
*Experts* Nerseus Posted August 4, 2004 *Experts* Posted August 4, 2004 I'm no DB Admin, but I don't think anything like that exists in SQL Server (null out the child table's FK). You could probably do it with triggers assuming the foreign key allowed nulls. -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
ilya2 Posted August 5, 2004 Author Posted August 5, 2004 I'm no DB Admin, but I don't think anything like that exists in SQL Server (null out the child table's FK). You could probably do it with triggers assuming the foreign key allowed nulls. Thanks, I'm going to do it by triggers, though I will have to provide the referrential integrity by triggers too. I think that's very annoying feature of MS SQL that it does not support ON DELETE SET NULL and ON DELETE SET DEFAULT syntax. Quote Ilya
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.