Well....heres the deal. The parameter is a select statement for a table. I didn't think this information would help, but now it looks like it might....
I have an asp page that sends a parameter (the sql select statement) to an asp.net page (the generic one that our business uses for reports) that sends the parameter to a crystal report. The report then calls a procedure with this paramter.
Now here is where I think the problem may be...If I leave the paramter string intact it causes an error going from the asp page to the .net page because url's can not have certain characters(>>,= etc.) so I replaced those characters with a word(such as = becomes equalsymbol) on the asp page. So the paramter should be coming into the stored procedure through the crystal report with the symbols replaced. Then in the stored procedure I'm doing this:set @SQL = replace(@p_sql_line,"equalsymbol","=") . And then I execute @SQL.
Here is something else: If I run this procedure in SQL with the parameter as it should be (without the replace) it runs fine. And it is over 128 length. However, if I use the replace words, I get the error.
I was trying to figure out this problem without mentioning the crystal report and asp.net page because this is a SQL forum...