I have a linked server statement using OpenQuery:
SELECT mycol1, mycol2, mycol3
FROM OPENQUERY(MYLINKEDSERVER, 'SELECT * FROM mysqldb.table')
The above works with no qualms in SSMS. When I use PHP MySQL wrappers to run this query on a web application (using same SQL Server credentials), I have to insert the following 2 statements:
SET ANSI_NULLS ON
SET ANSI_WARNINGS ON
I've read through the definitions for ANSI_NULLS and ANSI_WARNINGS, but don't quite understand why they have to be set to on for the query to function in PHP.
Does anyone know the reason?
My linked server is a MySQL instance.