|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50811 mssql_bind fails to bind parameters greater than 256 characters long
Submitted: 2010-01-20 23:05 UTC Modified: 2013-02-18 00:34 UTC
Avg. Score:4.6 ± 0.5
Reproduced:7 of 7 (100.0%)
Same Version:4 (57.1%)
Same OS:3 (42.9%)
From: paul at dezinnia dot com Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 5.2.12 OS: Windows Vista
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
2 + 23 = ?
Subscribe to this entry?

 [2010-01-20 23:05 UTC] paul at dezinnia dot com
using the mssql database extension, i am attempting to bind a parameter 
of type nvarchar(1999) to a stored procedure.  Everything works as 
expected except when the length of the parameter exceeds 256 chracters.  

In the case of a parameter length in excess of 256 characters the 
following message is returned by the DB server.  "Procedure or function 
'FunctionName' expects parameter '@ParameterName', which was not 

Reproduce code:
From manual page: function.mssql-bind

this code won't reproduce the bug since you don't have access to my database...but i'm including it here so you you can be sure i'm not just getting a syntax error...

$sp = mssql_init("dbo.AddSnippet", $db);

$b = mssql_bind($sp, "@SnippetName", $snippetName, SQLVARCHAR, false, false, 120);
$b = mssql_bind($sp, "@SnippetDescription", $snippetDescription, SQLVARCHAR, false, false, 480);
$b = mssql_bind($sp, "@SnippetContent", $snippetContent, SQLVARCHAR, false, false, 1999);
$b = mssql_bind($sp, "@tagstring", $tagstring, SQLVARCHAR, false, false, 1999);
$b = mssql_bind($sp, "@TagUserID", $tagUserID, SQLINT4);


Expected result:
The stored procedure should add a record to the database and is designed 
to store nvarchar values of lengths up to 1999 characters.

Actual result:
When the parameter length exceeds 256 characters, an error occurs.  

When the parameter length is <=256 characters, no error occurs.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-18 16:40 UTC]
-Status: Open +Status: Feedback
 [2010-03-18 16:40 UTC]
Does mssql_bind() issue any warning or return false?
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 15:01:31 2024 UTC