I wrote a joined updated statement today, and figured it would be good to get some generic code up here to reference in the future. Here is how to do a simple update that updates the values of one table, to another on a common key.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
|a.Field1 = b.Field1,|
|a.Field2 = b.Field2|
|from tableA a|
|inner join tableB b on a.fKey = b.pKey|
|where a.pKey = @someValue|