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 |
programer
Posting Yak Master
221 Posts |
Posted - 2010-09-16 : 12:36:21
|
HiI have two table:- tbl_Payments- tbl_PaymentDetailsQuery:DELETE FROM tbl_PaymentsFROM tbl_Payments INNER JOIN tbl_PaymentDetails ON tbl_Payments.ID = tbl_PaymentDetails.IDThis query deletes the data from the first table.Data from other tables are not deleted.Please help how to delete a single query data from the first and second table. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-09-16 : 13:13:07
|
in your case it can be achieved using ON CASCADE DELETE option on tbl_PaymentDetails------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
programer
Posting Yak Master
221 Posts |
Posted - 2010-09-16 : 13:24:11
|
quote: Originally posted by visakh16 in your case it can be achieved using ON CASCADE DELETE option on tbl_PaymentDetails------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
Is there a case for it? On the Internet, I can not find anything suitable.Or how to achieve it? |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-09-16 : 13:28:18
|
you'll specify it when you create foreign key on tbl_paymentdetails------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|