November 30, 2012 at 3:34 pm
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.
November 30, 2012 at 4:37 pm
After experimenting for awhile, I determined that only the PRINT statement (PRINT @Variable1 + @Variable2) truncates to 8K. The EXEC statement does not. Problem solved.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy