0

I'm trying to insert emoji into NVARCHAR(MAX) column from PHP but I get error. The same query executed by SQL Server client works fine so the problem is query/connection size.

INSERT INTO table (text) VALUES (N' example')

I get error:

Incorrect syntax near ''

I'm using PHP mssql_connect driver with mssql.charset set to UTF-8.

PHP version 5.6
SQL Server version 2016

Zhorov
  • 28,486
  • 6
  • 27
  • 52
Lorenzo
  • 41
  • 9
  • 1
    The PHP code will help us. If possible, post your PHP script(s). Also, `mssql_connect` is part of the old and unsupported MSSQL driver for SQL Server. A better option is to use PDO and PHP Driver for SQL Server. – Zhorov Oct 12 '21 at 09:11
  • What sorting do you use in the database/table? – Lukas Oct 12 '21 at 09:11
  • Your SQL (apart from the undelimit identified reserved keyword for an object name) works fine: [db<>fiddle](https://dbfiddle.uk/?rdbms=sqlserver_2019&fiddle=64f72011f4fcab9c4ba359a88eba431b) – Thom A Oct 12 '21 at 09:26

0 Answers0