思路:
先用一个方法取出表中的所有字段
select name from syscolumns where id=object_id('表名')
然后组成SQL需要的格式--将表名链接成串
select stuff((select ','+Convert(nvarchar,name) from
(select name from syscolumns where id=object_id('taxbill'))x for xml path('')),1,1,'')
思路:
先用一个方法取出表中的所有字段
select name from syscolumns where id=object_id('表名')
select stuff((select ','+Convert(nvarchar,name) from
(select name from syscolumns where id=object_id('taxbill'))x for xml path('')),1,1,'')