有没有办法像使用插入语句一样更新 SQL Server 中的多个列?
就像是:
Update table1 set (a,b,c,d,e,f,g,h,i,j,k)=
(t2.a,t2.b,t2.c,t2.d,t2.e,t2.f,t2.g,t2.h,t2.i,t2.j,t2.k)
from table2 t2
where table1.id=table2.id
或者类似的东西,而不是像这样:
update table set a=t2.a,b=t2.b etc
如果您有 100 多列,那么写起来可能会很烦人。