Returning varchar(8000) only allowing a return of 4000 characters
Posted on 2009-05-03
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