Friday, 9 March 2018

Update a table using JOIN in SQL Server

  1. UPDATE t1  
  2. SET t1.TID = t2.DOID  
  3. FROM dbo.Table1 AS t1  
  4. INNER JOIN dbo.Table2 AS t2  
  5. ON t1.CommonField = t2.[Common Field] 

No comments:

Post a comment

Types of SQL Server Backups

Overview SQL Server offers many options for  creating backups.  In a previous topic, Recovery Models, we discussed what types of backups c...