July 13, 2007 at 5:29 pm
Quick question: I have two table variables and need to perform an update on one of them based on the contents of the other. Can I perform an UPDATE operation that contains an inner join? If so, what would the syntax look like?
Thanks.
July 13, 2007 at 8:31 pm
From the FROM clause down, updates with joins look pretty much like what you'd find in a SELECT...
UPDATE t1
SET somecol =t2.somecol
FROM @Table1 t1,
@Table2 t2
WHERE t1.someothercol = t2.someothercol
--Jeff Moden
Change is inevitable... Change for the better is not.
July 13, 2007 at 9:07 pm
Thanks Jeff, that's exactly what I needed.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply