Solved

update from Backup table

Posted on 2011-09-07
2
297 Views
Last Modified: 2012-05-12
I have 2 tables.  Table1(Id,ColA,ColB,ColC) and TableBackup(Id,ColA,ColB,ColC).
Table2 has the same columns as Table1.
I would like to update ColA and ColB in Table1 with ColA and ColB from TableBackup.  The Id is the same in both tables.
How is best to do this?
0
Comment
Question by:johnkainn
[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
  • 2
2 Comments
 
LVL 33

Accepted Solution

by:
knightEknight earned 500 total points
ID: 36498772
update Table1
set ColA = T2.ColA, ColB = T2.ColB
from Table1 T1
join Table2 T2
  on T2.Id = T1.Id
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 36498781
oops, use "TableBackup" instead of "Table2" in the join clause
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

627 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