Solved

Getting data from one table to another

Posted on 2004-10-06
3
173 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
3 Comments
 
LVL 28

Accepted Solution

by:
iboutchkine earned 150 total points
Comment Utility
execute SQL
insert into T2 select * from T1
0
 
LVL 1

Author Comment

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

Assisted Solution

by:checoo
checoo earned 100 total points
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now