SQL: Update Multiple Columns

It’s really easy to use SQL to update multiple columns of your table at once with different values.

Starting point

As example we will update the following table:

dogs-sql-table

UPDATE Syntax

UPDATE [Table-Name]
SET
    [Column1] = Value1,
    [Column2] = Value2,
    ....
WHERE [Condition]

The WHERE clause is optional.

Example

A simple example referring to the RobotDog table can be:

UPDATE RobotDog
SET
    Armed = 1,
    Guns = 10
WHERE Name LIKE "[A value of choice..]"