34,575
社区成员
发帖
与我相关
我的任务
分享
declare @col varchar(1000)
set @col=''
select @col=@col+','+name from syscolumns where id=object_id('表名') and name<>'排除的字段名' order by colid
set @col=stuff(@col,1,1,'')
exec('select '+@col+' from 表名')
select d,k,...y from table