Solved

Getting data from one table to another

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

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

Suggested Solutions

Title # Comments Views Activity
Error handling in asp.net site 5 34
No Data for DropDown List 2 28
How to seperate number and letters from a string 3 22
Iteration Help (Asp.net VB) 5 24
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

792 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