In SQL2K, having generated a stored proc from a template by applying parameters within a generator proc, we now need to actually CREATE it. Unfortunately the total length of the generated proc is greater than 8000. Not being able to use Text datatype as a local variable, we tried
execute(@SQL1 + @SQL2 + @SQL3)
in which the three variables are varchar(8000). It executed OK, but the cataloged procedure only has the first 8000 bytes. What is the best way to generate a stored proc within another stored proc?