Sunday, June 29, 2014

update one table from another when the column names match

One workaround is the UPDATE...FROM syntax:



update p
set prims=(select PrimOwners.prims from PrimOwners where PrimOwners.avatarkey=p.avatarkey)
FROM @people p;





Dan Guzman, SQL Server MVP, http://www.dbdelta.com


No comments:

Post a Comment