i need to know which approach is good in-terms of performance while deleting the records from two tables...
Here is my table struct:
Expand|Select|Wrap|Line Numbers
- Master table (table1)
- -------------------------------
- MasterTable_ID (PK)
- App_ID (FK)
- Tran table (table2)
- -------------------------------
- Tran_ID (PK)
- MasterTable_ID (FK)
I need to delete list of records (from both table1 and table2) associated for a given App_ID...
so there are two possibility
[1] First get list of records from Table1 for a given App_ID and delete its associated records in table2 (using loop) and in last-step delete records from table1
[2] use Subquery to delete all records from Table2 and delete records from table1
(there will be max 30 trans-records in table2 for a given MasterTable record)
I think [2] is appropriate, but how do i convince my QA team subquery does not have performance issue (or is i'm wrong here)
Cheers
Venu