I'd like to compare 2 queries results in order to get non corresponding data.
I have a MS SQL server that is linked to a MySQL server.
My first query get the emails and the number associated to it on MS SQL database:
select email, number from [DB].[dbo].[Contacts];
My second query get the emails and the number associated to it on MySQL database:
select email, number from database.contacts;
I know that I can run a query on MySQL from MS SQL by using this kind of query:
SET @SQLStr = 'SELECT * FROM OPENQUERY([DB-01],''select email, number from database.contacts'')'
EXEC(@SQLStr)
But I have no idea of how to read and compare the results.
I'd like to know if email and number association existing in MS SQL database is different in MySQL server.
i.e.: if email = '[email protected]' and number = 00222 on MS SQL but email '[email protected] and number = 012325 on MySQL, I want to get the second result that is different.