You cannot declare a variable longer than 8000 characters. You cannot declare local variables of type text or ntext. You can however concantenate variables.
Declare @sql1 varchar(8000), @sql2 varchar(8000)
Exec(@sql1 + @sql2) Terry L. Broadbent - DBA
Computing Links:
According to SQL Setver BOL, the maximum "length of a string containing SQL statements (batch size) is 65,536 * Network packet size" where the network packet size is typically 4k. I've never come close to creating a query or procedure that was that long. Terry L. Broadbent - DBA
Computing Links:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.