M41DZ3N
M41DZ3N

Reputation: 346

Sync single table between MSSQL and MySQL

I need to synchronize a table between our MSSQL Database to our MySQL Database.

The MSSQL Datbase is the master, MySQL the clone.

I can not link the tables(thats the solution when you google it), i have to do it with Queries and a Cronjob.

I first thought of:

SELECT COUNT(*) FROM table;

And compare both but this does not detect changes in rows.

How is the best way to check for changes and new Data?

Upvotes: 1

Views: 759

Answers (1)

Jonathan
Jonathan

Reputation: 2063

You could MD5-hash the selected result and compare the hashstrings:

SELECT MD5( GROUP_CONCAT( CONCAT_WS('#',id,name,password) SEPARATOR '##' ) ) FROM table

Upvotes: 1

Related Questions