How to Update From Select Statement in SQL Server ?

Published on December 11, 2013 by Senthil Kumar

Filed under SQL Server

Last modified December 11, 2013

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 2 (1 votes)

This article have been viewed 14073 times

Below is a sample query that demonstrates how to update a table by getting the data from the select query in SQL Server. Assume that there are 2 tables AbundantCodeEmployee and AbundantCodeDepartment which contains the id . The id(in department) in this example refers to the department head . The columns “DepartmentName” is updated in the query based on the value retreived  .

How to Update From Select Statement in SQL Server ?

  AbundantCodeEmployee.DepartmentName = AbundantCodeDepartment.DepartmentName
ON =

Leave a Comment


You might be Interested in these Posts

How to update the value in a Dictionary in C# ?

Below is a sample code snippet demonstrating how to update the value that is stored within the dicti...

How to Perform Inner Join using LINQ in C# ?

Are you looking for the syntax on how to perform inner join using LINQ in C# ? . Below is a sample c...

Equivalent of IF Statement in SQL Server

There are times when you want to perform conditional checks within a SQL Query in SQL Server . Be...