Wednesday 08th of September 2010
News
Latest from Directory
| New Links |
|
| Update Join MsSql |
|
|
|
| Written by AlmaSeo |
| Wednesday, 18 November 2009 22:12 |
|
In some cases we need to update a column in a table according to a join on another table. Making all in a single statement on Microsoft SQL Server is not easy, let's see how we can work it out. Suppose we have a table of TERRITORIES and have to fill the column REGION DESCRIPTION according to the value retrieved from the second table REGIONS in join on the RegionID field
Territories table "TERRITORIES" ![]()
Region table "REGIONS"
the query toperform the update in the join is the following:
UPDATE TERRITORIES
ingenious, isn't it? |
| Last Updated on Thursday, 19 November 2009 18:43 |







