1

It is a possible of duplicate question may be but please suggest me some work around

I got this requirement.

I have a MSSQL Database with almost 30 Tables with millions of records. Now i need to take Replica of the same in MySql.

The Solution which i am thinking are (This may contains loopholes and it may not be good)

Sol 1 :- I created a linked server of MySql and by using trigger in MSSQL Tables and insert in MySQl For the existing records by using import wizard of workbench import the data.

Sol 2 :- Using SymmetricDS.

What is the best way to achieve this.

I am very new to Database Administration stuffs. Please help me in this regard.

Note :- After we replicated to MySql it should be in sync with MSSQL.

UPDATE :- If anyone knows as the way dan b said how to do it via SQL Server Replication Using ODBC please give some reference.

I tried this steps here. In the second step if i click new publication under Replication SSMS i got this error

SQL Server replication requires the actual server name to make a 
connection to the server. 
Connections through a server alias, IP address, or any other 
alternative name are not suppported. Specify the actual server name, 
'USER3-PC'. (Replication.Utilities)

I installed SQL 2008 R2 Express. And this i tried in my local machine.

shanmugharaj
  • 3,814
  • 7
  • 42
  • 70
  • They have to be kept in sync afterwards? Which one will be considered correct if both db's are written to? – Dan Bracuk Dec 23 '14 at 13:20
  • We are writing only to MSSQL. But we should find a way it should update that record in mysql also – shanmugharaj Dec 23 '14 at 13:24
  • [see this answer](http://stackoverflow.com/questions/8019144/how-to-migrate-mssql-database-to-mysql) – csaw Dec 23 '14 at 13:31
  • @csaw Thanks for for ur reply. I referred that link.. That is to copy the data but i need MySql to be in Sync with MSSQL. – shanmugharaj Dec 23 '14 at 13:44
  • There are other questions asking exactly that, however, most point to using other libraries. There is I believe a way to do it using MSSQL data replication and setting up mysql as an ODBC data source. Check all the relevant stackexchange answers. I don't see it there. You could then modify your question asking specifically if it can be done using MS SQL replication – dan b Dec 23 '14 at 13:48

1 Answers1

0

I would just create PHP scripts to do it. I would create on script per table and run them from the command line. There are drivers for both MSSQL and MySQL. Since PHP is loosely typed this should be a breeze. You can get the create and insert statements right from SQL Server Management Studio.

itsben
  • 1,017
  • 1
  • 6
  • 11