By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,483 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,483 IT Pros & Developers. It's quick & easy.

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

P: 6
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
Share this Question
Share on Google+
3 Replies


ck9663
Expert 2.5K+
P: 2,878
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

P: 6
could you please give any example to make it clear..
Dec 9 '10 #3

ck9663
Expert 2.5K+
P: 2,878
Here are some sample commands.

Good Luck!!!

~~ CK
Dec 9 '10 #4

Post your reply

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