Click here to Skip to main content
16,011,815 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

Is it possible to copy records from one MYSQL db tables on one server to another db tables on another server using some query? (both tables are exactly same).Because First i have to check main server database all tables,Then If any changes done in the database tables i have to do it in my second server db tables.I am using this in C# project..
Please give me solution..


Thanks & Regards,

E.MANI VIGNESH
Posted
Comments
Prasad Khandekar 21-Mar-13 3:22am    
INSERT INTO Database2.dbo.MyOtherTable (MyKey, MyValue)
SELECT ObjectKeyID, ObjectType FROM Database1.dbo.MyTable

This will work provided both the database are on same physical server.

You also have a Linked Server Entry in target server and use following type of query select * into targetTable from [sourceserver].[sourcedatabase].[dbo].[sourceTable].

1 solution

MySql provides MySqlBulkLoader[^] class to copy data from one into another database.

Example: how to bulk insert into mysql using c sharp[^]
 
Share this answer
 

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