Bulk Record Update with SQL

前端 未结 5 1447
你的背包
你的背包 2020-12-05 02:48

I have two tables in a SQL Server 2008 environment with the following structure

Table1
- ID
- DescriptionID
- Description

Table2
- ID
- Description
<         


        
5条回答
  •  粉色の甜心
    2020-12-05 03:14

    You can do this through a regular UPDATE with a JOIN

    UPDATE T1
    SET Description = T2.Description
       FROM Table1 T1
          JOIN Table2 T2
             ON T2.ID = T1.DescriptionId
    

提交回复
热议问题