Random Project

Heterogeneous queries over multiple servers

If you try the create a query over multiple servers you get the following error message (from freetds):

Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query.

Adding
$connection->query(“SET ANSI_NULLS ON”);
$connection->query(“SET ANSI_WARNINGS ON;”);
fixes the error.

Greetings