I am accessing MS SQLServer through Laravel, using Eloquent ORM or Query Builder. This works fine on all tables, but one particular table throws this error:
Please try :
$handle = getHandle();
$handle->exec('SET QUOTED_IDENTIFIER ON');
$handle->exec('SET ANSI_WARNINGS ON');
$handle->exec('SET ANSI_PADDING ON');
$handle->exec('SET ANSI_NULLS ON');
$handle->exec('SET CONCAT_NULL_YIELDS_NULL ON');
OR
You can also check the server configuration: check the "/etc/freetds.conf " file and change the tds version and add client charset then in php.ini please check mssql.charset and default_charset
in /etc/freetds.conf :
;tds version = 4.2
tds version = 8.0
client charset = UTF-8
In php.ini :
mssql.charset = "UTF-8"
default_charset = "utf-8"
Thanks.