Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 15th, 2004, 07:45 AM
Registered User
Join Date: Mar 2004
Location: , , .
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?


Reply With Quote
  #2 (permalink)  
Old April 15th, 2004, 03:48 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

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.

Work smarter, not harder
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 07:43 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.