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
 Transact-SQL (2000)
 Local variable exceeding Varchar(8000)

Author  Topic 

jung1975
Aged Yak Warrior

503 Posts

Posted - 2005-03-29 : 17:34:20
I have a local variable @SQL that will print multiple Insert statements which are exceeding the size of varchar(8000). I've tried to use a text data type, but it says I can't use a text data type as the data type of a local variable. Is there any other data type that I can use to handle the character string which is more than varchar(8000)?


robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-03-29 : 23:08:42
You'd have to use multiple varchar(8000) variables, which you can execute like this:

EXEC(@sql1 + @sql2 + @sql3)
Go to Top of Page
   

- Advertisement -