更新语句与多个更新语句SQL Server

时间:2016-12-07 19:39:55

标签: c# sql-server

我有一张桌子

User
(
  id primary key,
  firstName ,
  birthDate,
  salary
)

我想用birthDate>将所有用户的工资更新为400 2014-02-01(例如)。哪一个更适合不锁定,进行一次更新

Update User 
set salary = 400 
where birthDate > 2014-02-01

或选择birthDate>所有用户2014-02-1到我的c#代码,然后通过主键(如

)逐个执行更新
update User 
set salary = 400 
where id = xxx

请解释答案

0 个答案:

没有答案
相关问题