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 |
cognos79
Posting Yak Master
241 Posts |
Posted - 2006-10-13 : 15:24:43
|
can I delete records from two tables using a single sql statement. |
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2006-10-13 : 15:31:11
|
No, INSERT, UPDATE and DELETE all work on a single table at a time. Want to modify data in two tables, then you must execute two statements. |
 |
|
cognos79
Posting Yak Master
241 Posts |
Posted - 2006-10-13 : 15:31:31
|
Thanks... |
 |
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-10-16 : 04:41:50
|
if the tables are linked and there is cascade delete, possibledeleting the parent record deletes the child recordsbut I guess the question is of different nature--------------------keeping it simple... |
 |
|
Kristen
Test
22859 Posts |
Posted - 2006-10-16 : 05:33:58
|
You probably need a transaction if you need to use two statements - so that the first one can be rolled back if the second one fails!Kristen |
 |
|
|
|
|