laravelBatch
laravelBatch copied to clipboard
operator does not exist: ` character varying when using SQL-Server
trafficstars
when using SQLServer throw this error
[Illuminate\Database\QueryException] "SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near '`'. (SQL: UPDATE ...
so I need to remove backtick symbol from vendor\mavinoo\laravel-batch\src\Batch.php
from
if ($driver == 'pgsql' ) $final[$field][] = 'WHEN ' . $index . ' = '' . $val[$index] . '' THEN ' . $value . ' ';
to
if ($driver == 'pgsql' || $driver == 'sqlsrv') $final[$field][] = 'WHEN ' . $index . ' = '' . $val[$index] . '' THEN ' . $value . ' ';