declare @colname varchar(8000) select @colname=case when @colname is null then name else @colname+','+name end from syscolumns where id=object_id('你的表名') select @colname