Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 15th, 2004, 07:45 AM
Registered User
 
Join Date: Mar 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default migrating data using FOR EACH?

Hey Guys,

I have data in tableA that needs to be in tableB in the same DB.

I was wondering if I could use FOR EACH to move the data from table to table.

I've never used the statement before and have not found the info I need. Can someone help me with this?

Thanks,
Krs


 
Old April 15th, 2004, 03:48 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You would be best off to do this procedure with the database. Doing it thru ASP is kind of silly. Depending on what data you need to move, the criteria, the field structure, etc, you should be able to do this with a fairly simple database query. Something like this query should get you started:

INSERT INTO TableB(Field1, Field2, Field3) SELECT FieldX, FieldY, FieldZ FROM TableA

All you need to do is send this query to the database from a single ASP db connection and let the database do all the work.

Peter
-------------------------
Work smarter, not harder





Similar Threads
Thread Thread Starter Forum Replies Last Post
Migrating Foxpro Aprile SQL Server 2005 1 September 11th, 2007 08:51 AM
Migrating users¡¦ data into aspnet.mdf Caster BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 April 21st, 2007 10:18 AM
Migrating Data Problem Charlie05 BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 3 March 28th, 2007 04:08 PM
migrating data b/w two db g_vamsi_krish SQL Server 2000 2 March 8th, 2006 09:35 AM
migrating from vb to c# noman77 VS.NET 2002/2003 2 October 14th, 2004 05:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.