Click here to Skip to main content
15,890,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
DataBase1 Table A (in this table have some data)

DataBase2 Table B ( in this table have some data)


Table A in Have diffrent data and Tabel B have Different Data

we need B table data overided with A tabe data is it possible
Posted
Updated 8-May-12 7:35am
Comments
RDBurmon 8-May-12 8:23am    
Sorry but I really don't understand . Is it issue or question ?
Sandeep Mewara 8-May-12 8:45am    
This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.
Corporal Agarn 8-May-12 11:07am    
Please give more information. Do you want to override the data in a database? Where is the override data coming from?

1 solution

Pretty straight forward. Step is to drop table B and insert A table records into B. Sample SQL code is as:

SQL
----Clean Up target table B
DROP TABLE B

----Insert new records into target table
INSERT INTO B (FirstName, LastName)
SELECT FirstName, LastName
FROM A

----Verify that Data in B
SELECT FirstName, LastName FROM B
 
Share this answer
 
Comments
2011999 8-May-12 13:50pm    
hear databases are differnet. we are not loss the data A Table data or B Table data.
Corporal Agarn 8-May-12 15:02pm    
Does that mean you want the data from both tables to remain? Do you want both table to have all the data?
Maciej Los 8-May-12 17:59pm    
Please, specify your problem, provide more details... We can't read your mind...
Corporal Agarn 8-May-12 15:01pm    
GanesanSenthilvel - I think you would want a DELETE FROM B as if you did the DROP the INSERT INTO would not work.
Maciej Los 8-May-12 17:57pm    
I agree with you. My vote of 1.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900