You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected output: two identical rows inserted into the database.
Actual output:
The first row is inserted in the database, and the second fails with error:
HY104 [Microsoft][ODBC Driver 18 for SQL Server]Invalid precision value
This code works fine if SQLSRV_SQLTYPE_VARCHAR() is set <= 4000 or to MAX. If it is between 4001->8000 it produces the error above on the second insert. This also works if the SQL type is not specified in the prepared statement. Note that there is nothing changing between the inserts, it is just sqlsrv_execute being executed twice.
The text was updated successfully, but these errors were encountered:
Strangely, in my tests, I could reproduce this error with 5.10 version of the PHP driver, but not 5.11. But you're already using 5.11, so I will investigate this further
Versions:
PHP: 8.2.13
sqlsrv: 5.11.1
ODBC driver: 18.3.2.1
SQL Server: 14.0.3038.14
Server OS: Windows Server 2016
Test table:
CREATE TABLE dbo.TestTable (
TestColumn VARCHAR (8000) NULL
)
Test code: attached
TestCase.txt
Expected output: two identical rows inserted into the database.
Actual output:
The first row is inserted in the database, and the second fails with error:
HY104 [Microsoft][ODBC Driver 18 for SQL Server]Invalid precision value
This code works fine if SQLSRV_SQLTYPE_VARCHAR() is set <= 4000 or to MAX. If it is between 4001->8000 it produces the error above on the second insert. This also works if the SQL type is not specified in the prepared statement. Note that there is nothing changing between the inserts, it is just sqlsrv_execute being executed twice.
The text was updated successfully, but these errors were encountered: