Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL-Server and MySQL interoperability?

We're going from a SQL-Server 2008 backend to a MySQL backend. What's the interoperability between SQL-Server and MySQL?

Will we be able to run SQL Queries that reference tables from databases across the servers?

For example, is this possible: pseudo code

SELECT * 
FROM 
      [SQL2008Server].[databaseA].[DBO].[table1] as t1 
  INNER JOIN 
      [MySQLServer].[databaseB].[dbo].[table2] as t2 
          ON t1.id = t2.fkid

If not, what options can you recommend for integrating data across SQL-Server 2008 and MySQL?

Would LINQ provide any relief in regards to combining data from SQL-Server and MySQL?

like image 890
s15199d Avatar asked Apr 19 '12 12:04

s15199d


People also ask

Is MySQL and SQL Server compatible?

Default CompatibilityMySQL is compatible with every major operating system out there, even though it is traditionally associated with Linux. Meanwhile, SQL Server used to run exclusively on Windows, but this has changed since 2016 when Microsoft announced Linux and Mac support.

Can Microsoft SQL Server connect to MySQL?

To connect to MySQLOn the File menu, select Connect to MySQL (this option will be enabled after the creation of project). If you are previously connected to MySQL, the command name will be Reconnect to MySQL. In the Provider box, select MySQL ODBC 5.1 Driver (trusted).

Can I have SQL Server and MySQL on the same machine?

Answer: Yes, SQL Server and MySQL can coexist as they are totally separate entities. Both are irrelevant to each other and communicate on different ports. The default port for MySQL is 3306 and the default ports for SQL Server are 1433 & 1434. Thus, there would be no issues for running both of them on the same machine.

What is the relationship between SQL and MySQL?

SQL is a query language, whereas MySQL is a relational database that uses SQL to query a database. You can use SQL to access, update, and manipulate the data stored in a database. However, MySQL is a database that stores the existing data in a database in an organized manner.


1 Answers

It is possible to add a MySQL server into SQL Server as a linked server.

  • HOWTO: Setup SQL Server Linked Server to MySQL

Once you have set it up you can query using OPENQUERY like this:

SELECT t1.colA, t2.colB
FROM SQLdbName.dbo.tablename AS t1
INNER JOIN OPENQUERY(MySQLlinkedservername, 
                     'SELECT colA, colB FROM tablename') AS t2
ON t1.colA = t2.colA
like image 99
Mark Byers Avatar answered Sep 22 '22 00:09

Mark Byers