6
votes

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?

1

1 Answers

8
votes

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

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