表的字段名转为逗号相隔的字符串 2015/08/31 16201 select replace( replace( stuff( ( Select ',',Name From SysColumns Where id=Object_Id('表名') and name not in ('Id') for xml path('') ), 1, 1, ''), '<Name>', ''), '</Name>', '' )