取连成一串的字段
SELECT stuff
(
(
select ','+[name] from syscolumns Where ID=OBJECT_ID('表名') for xml path('')
),
1,
1,
''
)
取带逗号的字段
Select name + ',' from syscolumns Where ID=OBJECT_ID('表名');
标签:表中,name,OBJECT,Server,表名,SQL,syscolumns,Where,ID
来源: https://blog.csdn.net/hjmaAsC/article/details/123608064