Snowflake Update Table Value

Justin Aug 25, 2026

In the realm of data management, understanding how to update values in a table is a crucial skill. This is particularly relevant when working with data warehouses like Snowflake. Here, we'll delve into the process of updating values in a table within the Snowflake environment, ensuring your data remains accurate and up-to-date.

snowflake quality made partition by target - file size, and path layout ga for dynamic iceberg tables
snowflake quality made partition by target - file size, and path layout ga for dynamic iceberg tables

Before we dive into the steps, let's quickly understand why you might need to update values in your table. As your business grows and changes, so does your data. Regular updates ensure that your data reflects the current state, supports accurate analysis, and drives informed decision-making.

a long table with candles and snowflakes hanging from it
a long table with candles and snowflakes hanging from it

Updating Values in a Snowflake Table

Snowflake provides several methods to update values in a table. The most common way is using the UPDATE statement, which allows you to modify existing records based on specific conditions.

Elegant Snowflake Centerpieces That Feel Expensive (But Aren’t)
Elegant Snowflake Centerpieces That Feel Expensive (But Aren’t)

Let's consider a simple example. Suppose you have an 'employees' table and you want to update the 'salary' of an employee whose 'id' is 101.

Using the UPDATE Statement

Snowflake Dynamic Tables Benefits for Enterprise Data Teams
Snowflake Dynamic Tables Benefits for Enterprise Data Teams

Here's the basic syntax of the UPDATE statement:

UPDATE table
SET column1 = value1, column2 = value2, ...
WHERE condition;

In our example, the SQL command would look like this:

Snowflake Business Model: How Snowflake Works And Makes Money
Snowflake Business Model: How Snowflake Works And Makes Money

UPDATE employees
SET salary = 60000
WHERE id = 101;

This command updates the 'salary' column of the 'employees' table where the 'id' equals 101.

Modifying Multiple Rows

a dining room table with white snowflakes hanging from the ceiling
a dining room table with white snowflakes hanging from the ceiling

You can also update multiple rows at once by specifying a condition in the WHERE clause. For instance, you might want to increase the salary of all employees in a particular department:

UPDATE employees
SET salary = salary * 1.1
WHERE department = 'IT' AND salary < 50000;

a blue and white poster with information about snowflakes in english, spanish, and
a blue and white poster with information about snowflakes in english, spanish, and
a long table covered in snowflakes on top of a white table cloth with blue trim
a long table covered in snowflakes on top of a white table cloth with blue trim
an image of a facebook post with snowflakes on the table and in front of it
an image of a facebook post with snowflakes on the table and in front of it
Snowflake vs. Databricks: What’s the Real Difference?
Snowflake vs. Databricks: What’s the Real Difference?
the snowflake data platform is shown in this info sheet, with information about how to use it
the snowflake data platform is shown in this info sheet, with information about how to use it
Snowflake CoWork Readiness Checklist
Snowflake CoWork Readiness Checklist
How to Transform Your Data in Snowflake - KDnuggets
How to Transform Your Data in Snowflake - KDnuggets

This command increases the salary of all IT employees currently earning less than 50000 by 10%.

Handling Conflicts and Ensuring Data Integrity

When updating values, conflicts can arise if multiple transactions attempt to update the same row simultaneously. Snowflake's conflict resolution rules help manage these situations.

You can also use temporary or permanent row-level locks to control access to specific rows, ensuring data integrity during updates.

Conflict Resolution

Snowflake uses a few types of conflict resolution rules, including ABORT, SKIP, and MERGE. Each rule handles conflicts differently, so choosing the right one depends on your specific use case.

ABORT is the default and most conservative rule. It cancels transactions if a conflict arises. SKIP allows transactions to continue but discards the operation that caused the conflict. MERGE attempts to combine changes from conflicting transactions.

Row-locking

Row-locking allows you to lock specific rows, preventing other transactions from modifying them until your transaction is complete. This ensures that a single transaction can update a row without interference.

SELECT * FROM employees FOR UPDATE OF salary WHERE id = 101;

This command selects the row with ID 101 and locks it for the current transaction, ensuring that other transactions can't update it simultaneously.

Regularly updating your Snowflake tables ensures your data remains accurate and relevant. Understanding how to use the UPDATE statement and manage conflicts is vital for efficient data management. As your business grows, consider automating these updates to maintain data integrity seamlessly.