Is it possible to Connecting MYsql with sql server? - mysql

I am using an open source software which support mysql and i create application that uses asp.net 4.0 and sql server 2008....
Is it possible to Connecting MYsql with sql server ?
I want every insertion and updating should be made to both database servers as they have same schema of tables but one is mysql and other is sql server 2008 ?
kindly explain step by step if possible

hope this will help,this shows step by step connection
http://www.codeproject.com/Articles/29106/Migrate-MySQL-to-Microsoft-SQL-Server

You can use linked server in MS SQL Server.
From the documentation - A linked server allows for access to distributed, heterogeneous queries against OLE DB data sources.
Have a look at sp_addlinkedserver function.

Related

How to connect Azure Database for MySQL flexible server in Azure SQL Server Database

I am trying to set up a connection between Azure MySQL flexible server and Azure SQL database mainly to read data from MySQL and store it in the SQL Server periodically (multiple times a day).
I was thinking of creating a stored procedure inside my SQL Server database; however, I cannot seem to get a connection from the SQL Server into the MySQL database.
I know with ODBC you can connect MySQL to on-prem SQL Server, but unfortunately, there is nothing I have found for the same functionality for Azure SQL Server.
Has anyone done this? Is this possible?
I have tried to set up an ODBC connection, but it did not work as the SQL Server is on Azure.
I tried setting up a linked server inside SQL Server straight to MySQL, but it doesn't seem possible as the SQL Server is not on-prem.
I tried creating external database objects based on the following link.
With all these approaches, my expectation was to surface the MySQL tables from Azure SQL Server/SSMS.
Thank you for your help in advance!
MySql Workbench is the perfect option for connecting the azure database for mysql.
for that we need to create flexible server in azure portal. I created flexible server in azure portal.
Image for reference:
I created database in flexible server by clicking add in in database option. it crated successfully.
Image for refence:
I installed MySQL Workbench in my local system.
you can get your required fields to connect the server in connect tab.
Image for reference:
I connected to the server by filling required fields.
Image for reference:
Click on ok. It connected successfully.
Image for reference:
AFAIK Export the data from Azure mysql flexible server in the form of sql script through MySQL work bench and import that file in Azure sql database through SSMS. IN this we can write data into Azure Sql database.
I have had to create an Azure Function App that contains a Timer function that reads the data from the MySQL data and pushes it to SQL Server every 15 minutes (as were the requirements).
Thank you for everyone for commenting.
It seems you can use Data-in replication.

how to do Data replication on MS SQL Linked server

We have created a MS SQL Linked server for a MYSQL database...I have a data replication questions related to linked server
1.Once a MS SQL Linked server is created between MYSQL and MS SQL,if we insert any new data into existing tables of MYSQL,does the data get automatically replicated to the MSSQL Linked server?
2.If we add new tables or columns how to data replication is handled between MYSQL and MS SQL linked server?is there an automated way to replicate data?
A linked server in SQL server simply provides you the capability to issue commands against a remote server. It does not mean any kind of replication will happen automatically for schema or data. As to how to actually accomplish replication between SQL Server and MySQL, the question has been asked and answered many times. As far as I know you will need to use a third party framework or roll something of your own via ETL, triggers, etc.
https://msdn.microsoft.com/en-us/library/ms188279.aspx
Replication from MySQL to MS SQL

SSIS linked to a mySQL server

in SQL server it's possible to link a mySQL server into msSQL and query it using SSMS for example. I want to try this and use SSIS to do some transformations and store all the data on this mySQL database.
\I read that there a several ways to link to mySQL into the msSQL server. OLE DB, mySQL ODBC etc etc.
2 questions:
Are there any limitations i might run into when i will use a combination of SSIS and mySQL instead of msSQL?
When i link a mySQL database into msSQL and i write a query in SSMS, do i write the queries in mySQL language or msSQL language. For example the difference in TOP and LIMIT
I have worked with a linked MySQL Server from SQL Server in the past and ran into some issues.
Querying MySQL from SSMS (SQL Server)
Once you have created a linked server you would imagine you should be able to use the four-part name and query the tables in MySQL but it doesnt allow you. for example you cannot do something like...
Select * from MySqlServer.DbName.Schema.TableName
For some reason it throws an error. So the question whether I can use T-SQL in SSMS to query a Linked MySQL Server? Nope, unfortunately not.
But alternatively Microsoft recommends using OPENQUERY to execute queries to a linked server.
When using OPENQUERY, SQL Server does not try to parse the query, it just sends it to the linked server as it is. which means you can/should be able to write MySQL in SSMS using OPENQUERY and it will work.
Using SSIS with MySQL
Even though SSIS is Microsoft's tool that comes with SQL Server but it is a proper ETL tool which can read data from multiple sources and send data to many types of destination.
Once you have used the appropriate driver to connect to MySQL and ported data in SSIS package , its really not relevant anymore, where the data came from? you would have access to all the SSIS tools and you should be able to use them as if the data was coming from a flat file, SQL Server or Excel sheet etc.
By using Linked Server in MSSQL you can also connect to mySql. for that you need to download ODBC drivers. and then you have to create new dsn and while creating dsn you have to insert mySql server's details. then you can further search regarding how to create Linked server on SQL SERVER. This option is very easy and Totally free. You can use OPEN QUERY FOR inserting, updating, deleting and also get the data out from mySQL.

How to access remote MicroSoft SQL Server database from a stored procedure in MySQL

I need to access a remote Microsoft SQL Server database from a stored procedure in MySQL database.
I googled and found that there is a way to access a remote MySQL using federated tables. But I couldn't find anyway to do access MS SQL Server. My exact requirement is, I need to write a stored procedure which can duplicate all the tables and data from a remote MS SQL server database to a local MYSQL database.
Please help..
In short this cannot be done with MySQL federated engine. However you can setup a link from the remote MSSQL server to a MySQL table using the linked server feature of the MSSQL server.
If you can set this up you can have a scheduled job populate the MySQL tables from the MSSQL server side.
I have done the above setup and it is not to difficult.
I would also investigate some ETL tool to do this as it sounds like a ETL job and not something you want to run via stored procedures.
Good Luck.

MySql emulation running on Microsoft SQL 2008

We have an application that cannot be altered. The only configuration changes permitted on the application are : host ip, username and password.
The application streams data into a MySql database. Another application then sends this data onto a Microsoft SQL 2008 server.
I would like to remove this middle step and wondered if anyone knew of a way that Microsoft SQL Server 2008 could be configured to 'pretend' to be a MySql database?
Your help is very much appreciated.
Why 'send' the data to the SQL Server when you can just create a linked server?
It cannot be done. MySql and MSSQL are 2 completely different products with different connectionprotocols, a different SQL dialect, different behaviour at times and so on.
I'm sorry.