Results 1 to 3 of 3

Thread: -Sovled --What way to delete a record and use that record to add into another table ?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    San Jose
    Posts
    276

    Question -Sovled --What way to delete a record and use that record to add into another table ?

    I have an ASP page and I want to delete a record based on ID number from table 1 and I also need to save that record at table 2. How to do that without pulling out values to insert in table 2 before delete it ? Thanks
    Last edited by learnervb; Jan 22nd, 2003 at 06:06 PM.
    Tiny Mickey

  2. #2
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    Remember to insert record in table first, and then delete from original.
    If it's an Access DB:

    Code:
    INSERT INTO Table2
    SELECT Table1.*
    FROM Table1
    WHERE (((Table1.ID)=2));
    In SQL I belive there is SELECT INTO statement that allows you to copy data from one table to another with the same structure.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    San Jose
    Posts
    276
    Andreys, I copy your code and it works in SQL too. Thanks
    Tiny Mickey

Posting Permissions

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



Click Here to Expand Forum to Full Width