Solved

T-SQL: UPDATE query

Posted on 2013-11-07
1
359 Views
Last Modified: 2013-11-19
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
Comment
Question by:quasar_ee
1 Comment
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 39631377
UPDATE Table1
SET Table1.Column2 = Table2.Column7
FROM Table1
   JOIN Table2 ON Table1.table2ID = Table2.Table2ID
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now