Can someone explain why the following proc is only returning 4000 characters? QA is set to 8192, btw. If I run a len on the retval it returns 4000 characters when there are about 5000 worth of the columns I am returning.
declare @retval varchar(8000)
select @retval = coalesce(@retval + ',', '') + '[' + column_name + ']' from information_schema.columns where table_name = @table_name and column_name not in (@skipcols) order by column_name