473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

How to copy or insert records into the previously created table from another table?

hello guys I want to copy or insert records into the previously created table from another table..
For example I have two tables A and B ....
I want to copy or insert records from table B into table A ....

But here is a little problem, table A has some records that I don't want to be overwritten by the records that are being copied or inserted from table A ....
infact I want that all these records that are being copied from tabe B into table A should be seen after the previous records of table A ...


consider the following example:

following are two tables:

table A table B
--------- ---------

id ename id ename
--- ----- --- ------
101 sam 103 rohit
102 kan 104 alok



and I want my records into table A like this:

table A
---------
id ename
--- -----
101 sam
102 kan
103 rohit
104 alok
Dec 8 '10 #1
3 2685
ck9663
2,878 Expert 2GB
Doing an INSERT statement will not overwrite your data on your target table. It will just appended into the target table. The sequence, however, will depend on the index of the table. If you have an index on the ID column, once inserted you will not be able to identify which records came from where unless you have a column that will indicate the source.

Good Luck!!!

~~ CK
Dec 8 '10 #2
could you please give any example to make it clear..
Dec 9 '10 #3
ck9663
2,878 Expert 2GB
Here are some sample commands.

Good Luck!!!

~~ CK
Dec 9 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: PT | last post by:
I got a problem. And thats..... First of all, I got these three tables. ------------------- ------------------ ---------------------- tblPerson tblPersonSoftware ...
3
by: Reddy | last post by:
Hi, I need to insert records into two tables another after the other. Is the following code ok or is there a more efficient way of doing this using sqlcommand object con.Open() ...
1
by: travismorien | last post by:
I have four tables of different "entities". One table contains information for "people", one for "trusts", one for "companies" and one for "self managed super funds". Each type of entity has an...
1
by: Jan | last post by:
I have a table with autoincrement unique ID plus name (required not to be blank) and other fields. I have a list of names in another table and would like to do insert to the name field of the...
3
by: wvmbark | last post by:
First time poster... I just found this forum and it appears there's plenty of people here that could make short work of problem that's been driving me absolutely bonkers for months. Every day we...
4
by: BulbFresh | last post by:
Hi, I'm using Access 2007. I have imported a table called 'January' and from this I need to update an existing table called 'TablesInfo' which needs to hold some details about the imported...
0
by: barkarlo | last post by:
I make pivot table in excel. in page field is item month. in row field is employees. in column field is working hours,sunday hours, overtime and ect. Now I want with VBA code copy/paste only...
1
by: cathycros | last post by:
Hi, I'm trying to take data from varchar fields in one table and copy it to Nvarchar fields in another table. (Long story - now dealing with multiple languages, not enough space in row in current...
6
by: vikvikash | last post by:
hi i have split the data using the split command now i want to insert the split data to be inserted into another table. there r many records in the previous table i want each record to be split and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.