Hello Everybody! In this article, we want to discuss about how to update table from another table in SQL Server. Before we get started, if you want to know about format DateTime, please go through the following article: How to format a Datetime value in SQL Server.

Sometime we need to change/update one or multiple column in a table based of another column in another table in SQL Server. This may very simple or usually daily requirement. In SQL Server you can do this using UPDATE statement by joining tables together. To understand this better let’s take a look at below contrived example. I have to different table by named Customers and Orders.

In the above data I want to update OrderAmount column of dbo.Customers with values from Amount column of dbo.Orders. To achieve this we can use UPDATE statement as below:

We can update multiple table from another table as we wish. Another Example:

Update table from another table using inner join in SQL Server

Leave a Comment