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)
 Varchar(8000) not big enough as a local variable

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-13 : 09:58:55
Ben writes "Hi Guys. I have a stored proc building up a dynamic SQL statement into a string, then I execute the string. Problem is, is that the string can potentially exceed 8000 characters. I get an error trying to use "text" as a local variable in the sp. I looked it up and all I found was to concatenate strings:

EXEC(@SQL1+@SQL2)

but it still only takes the first 8000 chars. I have to use SQL Server 7. Is there any workaround please?

Thanks.

Ben"
   

- Advertisement -