• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 383
  • Last Modified:

T-SQL: UPDATE query

Table1
---------
PK int
Table2ID nvarchar
Column3 nvarchar

Table2
---------
PK int
Table2ID nvarchar
Column7 nvarchar

Have to update rows in Table1.Column2 with matching values from Table2.Column7.
Matching done using Table2ID not numeric column.

Thanks!
0
quasar_ee
Asked:
quasar_ee
1 Solution
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
UPDATE Table1
SET Table1.Column2 = Table2.Column7
FROM Table1
   JOIN Table2 ON Table1.table2ID = Table2.Table2ID
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now