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 |
|
JimmyFo
Starting Member
11 Posts |
Posted - 2007-06-15 : 15:59:30
|
| Hi, I have a number of tables and I need to delete from all of them at once - I will be deleting one row in one table, then deleting all the rows in another which use that just deleted row as a foreign key; I ALSO need to delete from a third table, where any foreign keys that match any rows just deleted in the second table.How can I do this? Do I need to do multiple selects, get the rows, then run stored procedures from there? Any other ways around this?Thanks,James |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-06-15 : 16:35:35
|
| Did you use 'on delete cascade' when create fkey? If not, have to delete rows from fkey tables first. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|