Solved

T-SQL: UPDATE query

Posted on 2013-11-07
1
369 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 66

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how the fundamental information of how to create a table.

689 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