multiple update sql query code example
Example 1: sql run multiple updates in one query
UPDATE table_name
SET field_name =
case field_name2
when 'value' then 'change_to'
when 'value2' then 'change_to2'
end
Example 2: sql server update multiple columns at once
UPDATE Person.Person
Set FirstName = 'Kenneth'
,LastName = 'Smith'
WHERE BusinessEntityID = 1
Example 3: update multiple columns in sql
UPDATE table-name SET column-name = value, column-name = value WHERE condition = value