Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jung1975
Aged Yak Warrior
503 Posts |
Posted - 2009-01-06 : 11:21:04
|
Is it a best database design practice to create both ON DELETE CASCADE and ON DELETE NO ACTION to implement Reference integrity?or just ON DELETE NO ACTION ? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-06 : 11:36:22
|
didnt understand why you should do both. actually it depends on what your business rule suggest, if reqmnt is to automatically clear the refered records once master is cleared, then go for ON DELETE CASCADE else ON DELETE NO ACTION if you still want to perform the action if it doesnt violate constraint |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2009-01-07 : 07:22:47
|
I'd recommend to use ON DELETE NO ACTION as it will make your code more understandable when stuff is not going on "behind the scenes"...- Lumbago |
|
|
|
|
|