update #tb set col1='',col2='',col3=''.... where id=1
的确是更新列的,不过你可以指定条件如update tb set col1='a'更新tb表col1列的值全部为aupdate tb set col1='a' where pkid=1更新tb表col1列的值全部为a 条件是满足pkid列=1
如果各个列所要更新的条件不一样的话,那么只能分别写一条语句,比如 update 表 set [col1] = '第一列' where [条件]='条件1' update 表 set [col2] = '第二列' where [条件]='条件2' update 表 set [col3] = '第三列' where [条件]='条件3'
set col1 = ...,
col2 = ...,
col3 = col1 + col2,
col4 = getdate()
where id=1
update 表 set [col1] = '第一列' where [条件]='条件1'
update 表 set [col2] = '第二列' where [条件]='条件2'
update 表 set [col3] = '第三列' where [条件]='条件3'