April 27, 2018 at 6:02 am
I have one MySQL based system(Version 14.1 Distribution 5.6.10) which is having one Database namely DB1 and a table Table1 inside the database.This is my source table that needs to be copied to Microsoft SQL server 2008 R2 system Database DB2 in to Table1. MS SQL Server 2008 R2 Database is my Destination Database. I have copied the whole Table1 from MySQL to SQL Server 2008 R2 by running a job through SQL Server Job Agent which in turns uses a Linked server and the Linked server is using an ODBC connection to copy Table1 from MySQL to MS SQL server 2008 R2. But this procedure copies the whole table once the Job Scheduler Run.
What I did is, I first Delete the exiting SQL server 2008 R2 database and then copy the whole MySQL Database on the scheduled time. But my requirement is once I copied the database, I want to copy it on incremental basis. The copy procedure should not copy the whole database by deleting
the existing one , but it should copy only the changed rows in MySQL database to SQL Server 2008 R2 database. I am a beginner in SQL and need help with queries and commands that are required to achieve my goal.Can some one tell me the steps and queries in this regard?
April 27, 2018 at 7:46 am
This is a pretty big topic for sure. Replication is your friend for this kind of thing. You will need to do a bit of research on replication so you are comfortable with how it all works. This question has good answer on the topic. The good news is that you don't have to write the queries yourself. 🙂
https://dba.stackexchange.com/questions/688/replicating-a-remote-mysql-database-to-ms-sql-server-2008
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply