Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2004
    Posts
    5

    Unanswered: Help with this query

    Folks

    I have a question. Can we delete data in two tables simultaneously?
    ie if we have two tables Test1 and Test2 in one database. I have to write one query
    which deletes the data in both the tables.

    ie Delete from Test1
    Delete from Test2

    Can we club these two queries??
    FYI: The tables donn have any relation between them.

    thanks for the help.

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Put a trigger on Table 1 to delete from table2?
    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.

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Is this another recruter's question?
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  4. #4
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    To club the tables, wouldn't you actually have to club the server? I wouldn't recommend this as a general rule. Of course, there have been exceptions.
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

  5. #5
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Other than trying to answer a seemingly challenging question, what's the point in doing it?
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  6. #6
    Join Date
    Feb 2004
    Posts
    492
    I've recently learned that it could be possible to do this via a 'partitioned view'. However, since both tables don't have _any_ relationship between 'em, I think rdjabarov has a point.

Posting Permissions

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