My SQL Server 2005 inline query is over 8K in length. The variable I'm using to store the query text is defined as Varchar(MAX). I have tried splitting up the inline query into 2 chunks of text, each one going into a separate Varchar(MAX) variable. However, when I PRINT or EXEC by concatenating the 2 variables, it cuts off once again at 8K. I'm using this statement:
PRINT @variable1 + @variable2
Any ideas how I can get beyond the 8K limit? My google search has some people stating that the Varchar(MAX) limit is 2GB, but that isn't my experience.