?
Solved

Getting data from one table to another

Posted on 2004-10-06
3
Medium Priority
?
217 Views
Last Modified: 2010-04-23
Hello EE,

I have a simple, novice like question. Ive got an app, thanks to RobertRFreeman, that imports data from a txt file to a sql table...everything works great and I couldnt be happier about it. But what I need to do now is move this information from the temp table to the production table and in the process have the option via two check boxes to insert over the existing data or to update and add to the existing data. Example...

If chkbox1 is checked then insert into and if chkbox2 is checked then update and add to the existing information.


Thanks alot for all the help this site is absolutely the best.

Joe
0
Comment
Question by:JoeDW
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 28

Accepted Solution

by:
iboutchkine earned 600 total points
ID: 12242322
execute SQL
insert into T2 select * from T1
0
 
LVL 1

Author Comment

by:JoeDW
ID: 12242483
thanks for the reply, let me give that go real fast.
0
 
LVL 9

Assisted Solution

by:checoo
checoo earned 400 total points
ID: 12245675
if you want to update the existing data (as mentioned for your 2nd check box) then you will be need to create a procedure with a cursor in it. The cursor should fetch the rows from the temp table and the the procedure should check if the row already exists in the production table, if it does then update it else insert a new row.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question