Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2004
    Location
    Treviso (Italy)
    Posts
    17

    Unanswered: Single Statement to delete record into more tables

    Hi ,

    I little question for you ... is it possibile to write a SQL statement to delete records in several tables at the same time?

    For example if I've two tables involved by join

    DELETE <...> from Customers A
    INNER JOIN CustomerProperties B ON A.CustomerID=B.CustomerID

    I Must use two statement to remove records from both the tables?

    Thx

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Not exactly, but you can approximate it. Check out Cascade to see if it will do what you need.

    -PatP

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Or use a trigger...just like in the good old days

    when we had to walk uphill to school, in the snow, with no shoes, both ways, all year...
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    ...and man was it rough trying to carry all of those clay tablets!

    -PatP

Posting Permissions

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