第3个回答 推荐于2016-03-08
declare @sql nvarchar(4000),@name_not_need nvarchar(100)
set @name_not_need='不要的字段名'
set @sql='select '
select top 1 @sql=@sql+name from syscolumns where name<>@name_not_need and id=(select id from sysobjects where name='表名')
select @sql=@sql+','+name+' ' from syscolumns where name<>@name_not_need and id=(select id from sysobjects where name='表名')
select @sql=@sql+' from 表名'
exec sp_executesql @sql本回答被提问者采纳