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)
 How to use EXEC for more than 8000 character strin

Author  Topic 

skaluva
Starting Member

17 Posts

Posted - 2002-07-30 : 10:27:01
Hi Everybody

I am trying to execute dynamic SQL statements using usual EXEC function successfully so far. Unfortunately right now the SQL statement I am trying to execute is more than 8000 characters. I wonder if any of you have an idea to execute this Statement. It is just a simple insert statement. I am sure it is failing just because of it's length.

Thanks in hand,
-- Sree

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-07-30 : 10:30:22
You'll have to create multiple varchar variables and execute them like this:

EXEC (@sql1 + @sql2 + @sql3)

While you can execute a text variable, you cannot manipulate it or edit it, so it's not really an option.

Go to Top of Page

skaluva
Starting Member

17 Posts

Posted - 2002-07-30 : 10:41:49
Haa..!!
I thought EXEC statement can handle only 8000 character long statements...
You are right, I realised now this will work.

Thank you
-- Sree

quote:

You'll have to create multiple varchar variables and execute them like this:

EXEC (@sql1 + @sql2 + @sql3)

While you can execute a text variable, you cannot manipulate it or edit it, so it's not really an option.





Go to Top of Page
   

- Advertisement -