Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Getting data from one table to another

Posted on 2004-10-06
3
Medium Priority
?
226 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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 …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Loops Section Overview
Suggested Courses

610 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