Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Posts
    1

    Unanswered: Delete from multiple tables

    I need to delete rows from more than one table 100 rows at a time. There is a main table, that determines what rows to delete. There are two columns that used to join the main table with others. Here is my solution:
    created a temp table with the two columns that used for join; then use the "while" loop to delete rows from the secondary tables; then another "while" loop to delete from the main table.
    Can anyone suggest any other way of deleting rows?

    TIA,
    Stan

  2. #2
    Join Date
    Jan 2003
    Location
    France - Nancy
    Posts
    26
    delete B
    from A,B
    where A.a1 = B.b1

  3. #3
    Join Date
    Jan 2004
    Posts
    51
    Another solution is to create a delete trigger on main table and in the trigger , delete from secondary tables..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •