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)
 Sql string more than 8000 byte !!

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-02-25 : 09:05:42
Brave writes "When I use 'execute' command to execute a sql string more than
8000 byte, I will see error message.
How can I solve this problem ?


CREATE PROCEDURE sp_test
AS
DECLARE @sql varchar(12800)
SET NOCOUNT ON
SET ANSI_WARNINGS OFF
...
-- PS. len(@select) > 8000
...
EXEC (@select)

SET ANSI_WARNINGS ON

GO"

Nazim
A custom title

1408 Posts

Posted - 2002-02-25 : 09:10:37
varchar can hold maximum 8000 characters.
you can hold the query in two variables.

exec(@var1+@var2)

HTH


--------------------------------------------------------------


Edited by - Nazim on 02/25/2002 09:12:30
Go to Top of Page
   

- Advertisement -