Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 max length of 46 characters for input-parameter of procedure?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-11-29 : 10:09:19
kirsty writes "hi there...

we use SQL 2000 Server Enterprise Edition with Service-Pack 1 installed on a Win2k Advanced Server environment.

when calling a procedure (from query analyzer) with one of the parameters having more than 46 characters it is giving these error messages:

execute p_searchsomething @pi_keyword='morethan46characters', @page= 1, @recsperpage=10


Server: Nachr.-Nr. 105, Schweregrad 15, Status 1, Zeile 1
Unclosed quotation mark before the character string '%morethan46characters'.
Server: Nachr.-Nr. 170, Schweregrad 15, Status 1, Zeile 1
Line 1: Incorrect syntax near '%morethan46characters'.


the in-pamameter @pi_keyword is defined as varchar(255).
why should the procedure call fail when the input-parameter string is longer than 46 characters?

thanks for any help - i've searched through any pages i know - but found nothing.

cheers,
kirsty"

izaltsman
A custom title

1139 Posts

Posted - 2001-11-29 : 10:29:27
Most likely, somewhere in your stored procedure you are building a dynamic SQL statement. I am guessing that you are building it in some variable before trying to execute it. As you are building it, you are probably appending @pi_keyword to the end (most likely as part of the WHERE clause). You are gonna have to make the variable in which you are building your string a little bigger.


Edited by - izaltsman on 11/29/2001 10:34:14
Go to Top of Page
   

- Advertisement -