Create function [dbo].[AF_TableColumns](@table_name nvarchar(55))
returns nvarchar(4000) as
begin
declare @STR nvarchar(4000)
select @STR = cast(rtrim(ltrim(column_name)) as nvarchar(500)) + coalesce('' + @STR , '')
from information_schema.columns
where table_name = @table_name
group...