Solved

Copy data from one table to another

Posted on 2008-06-11
2
194 Views
Last Modified: 2010-04-21
I have two tables, i need to copy data from one to another, below are the table names and field names, they are in the order in which they should be copied, like cases.id should be copied to activities.caseid, etc ...

table 1: cases

id, firmid, inscasenum, aosfiledat, i140filingdate, approvaldate, expdate, 1

table 2:  activities

caseid, firmid, actdesc, dateinitiated,lastmodified,schdemailon, complete

ONLY where cases.InsCaseNum is not null

How can I do this ?
0
Comment
Question by:amucinobluedot
[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
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 21760601
simple insert:
INSERT INTO activities ( caseid, firmid, actdesc, dateinitiated,lastmodified,schdemailon, complete )
 SELECT id, firmid, inscasenum, aosfiledat, i140filingdate, approvaldate, expdate, 1
   FROM cases
  WHERE cases.InsCaseNum is not null

Open in new window

0
 

Author Closing Comment

by:amucinobluedot
ID: 31466177
thx
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

726 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