终于找到了排除字段查询的方法了 。之前老是被人问倒。
declare @field nvarchar(
1000)
select @field=isnull(@field+
',',
'')+quotename(Name)
from syscolumns
where ID=object_id(
'表名') and Name not
in(
'排除1',
'排除2')
exec('select '+@field+
' from 表名')
View Code
转载于:https://www.cnblogs.com/ybyi/p/3228425.html