Sunday, June 29, 2014

update one table from another when the column names match

While Dan's solution is my preference, it also works if you put the table variable in brackets:


update @people set prims=(select prims from PrimOwners where PrimOwners.avatarkey=[@people].avatarkey)





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

No comments:

Post a Comment