对,确实要一个一个的写values(...),但是是不是有种方法可以不用1个1个的的把列名都写进去啊,因为我想表示的就是除了200列的其中1列,select语句中有没有那种可以不选某一列,而把其他列都包括进去的语句,比如select not in ("列名")之类的格式?
declare @str varchar(8000) set @str='' select @str=@str+','+name from syscolumns where id=(select id from sysobjects where name='tablename') and name<>'excludefieldname' order by colid print(stuff(@str,1,1,''))这样可以帮你少写些字。
select line_name2, line_name3 from tablename
明白我的意思了么
set @str=''
select @str=@str+','+name from syscolumns where id=(select id from sysobjects where name='tablename') and name<>'excludefieldname'
order by colid
print(stuff(@str,1,1,''))这样可以帮你少写些字。