Reference: String returned to Output Parameter from Stored Procedure is truncated
In PHP scripts, calling stored procedures from MS-SQL is necessary depending on a web application. In this case, if you are using MSSQL driver for PHP instead of the MSSQL module provided as a default driver, the following error message is sometimes seen.
01004 - [Microsoft][SQL Native Client]String data, right truncation
This is caused because the SELECT query does not specify fields explicitly like:
1: SELECT2: *3: FROM4: dbo.TableName
In order to avoid this error, just state field name explicitly like:
1: SELECT2: Field1,3: Field24: FROM5: dbo.TableName
Then, the error message above will no longer come out.


RSS2 Feed