Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

update from Backup table

Posted on 2011-09-07
2
Medium Priority
?
302 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
  • 2
2 Comments
 
LVL 33

Accepted Solution

by:
knightEknight earned 2000 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

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.

Question has a verified solution.

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

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
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 …
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

877 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