Solved

Copy data from one table to another

Posted on 2008-06-11
2
188 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
2 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
Comment Utility
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
Comment Utility
thx
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

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

16 Experts available now in Live!

Get 1:1 Help Now