Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving records to a different table

Status
Not open for further replies.

mmcgon

Programmer
Jan 12, 2003
29
US
I need to archive a set of records in one database table, moving and appending them to a table with an identical structure, using ADO. What is the slickest way to do this?
 
What DB are you using?

If MS-SQL then I would create a Stord Procedure and the run it.

If MySQL then you may want to do it in two parts.
One page copies all records to the new table, executing a

'insert into tablename
select from tablename'

after doing this redirects to a second page that gets all variables from the previous one, identifies records to be removed and executes a 'delete table name where...' statement.

If you post more info then I can be more specific.

Bye

Qatqat

Life is what happens when you are making other plans.
 
I'll be using either Access or SQL Server. I'd like to do it without using a stored procedure so I can use it for either database.

What I'm really interested in is seeing if there is an easy way to append a recordset I have obtained from one table to another table without having to loop through and insert each one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top