Does this really have to be dynamic SQL? Maybe you can parameterise it. Does the *entire* thing need to be dynamic SQL? Maybe there's just one section that needs to be dynamic. If it has to be dynamic I don't see how the limit on the PRINT statement (8,000 characters or 4,000 if it's Unicode) is stopping you from building the string and executing it. Both EXEC and sp_executesql can handle a string of almost any size. (OK, up to about 2GB but if it gets that big you've got something wrong.)
I figured this out. You have to break the query into 2 parts. BEGIN Declare @SQL1 varchar(8000) Declare @SQL2 varchar(8000) Set @SQL1 = ' 1st Part of Dynamic SQL Code Here ....' Set @SQL2 = ' 2nd Part of Dynamic SQL Code here ....' Print (@SQL1+@SQL2); Exec (@SQL1+@SQL2); END Thanks for the link above, it helped me figure it out.