|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32582 Stored procedure can not return a data typed varchar more than 255 bytes
Submitted: 2005-04-05 04:52 UTC Modified: 2005-04-05 05:39 UTC
From: liyong at nenu dot edu dot cn Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 5.0.3 OS: Win2K
Private report: No CVE-ID: None
 [2005-04-05 04:52 UTC] liyong at nenu dot edu dot cn
I want return varchar(600) from stored procedure,but it is shortened to 255 bytes.

Reproduce code:
stored procedure:
create procedure p_bug 
@msg varchar(600) output
 set @msg='something more than 255 bytes ......'

PHP statement:
echo $msg;

Expected result:
something more than 255 bytes ......

Actual result:
something shortened to 255 bytes


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-05 04:57 UTC] liyong at nenu dot edu dot cn
this problem is also scripted at
 [2005-04-05 05:05 UTC] liyong at nenu dot edu dot cn
sorry,it's 5.0.3,not 5.0.4
 [2005-04-05 05:39 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

The dblib library from Microsoft used to generate the MSSQL extension on Windows has not been updated since SQL Server 6.5. It's not possible to to fix this problem with Microsofts library.

Use text type to return values longer than 255 bytes.

I have a test version of php_dblib.dll available on my home page ( So far it's only available for php 5.1. It uses FreeTDS where the limmitations from the MS Library has been fixed. All functions names are still mssql_* so it's a very simple replacement
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 12:01:29 2024 UTC