Solved

Getting data from one table to another

Posted on 2004-10-06
3
195 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
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 100 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

773 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