December 15, 2005 at 4:35 am
Hi,
Is there a way to perform an update on a table variable using a join to a actual table?
This is the update i'm trying to run:
update @temp set @temp.desc = table1.desc from @temp, table1 where @temp.id = table1.idI've tried using an alias for the table variable instead of the variable name, but I can't seem to get that to work either.
Any ideas?
December 15, 2005 at 4:41 am
I think this is the correct syntax (not tested, though):
update s
set s.desc = t.desc
from @temp s inner join table1 t
on s.id = t.id
December 15, 2005 at 4:46 am
Hi,
Genius!
I've tested it and it works.
Thanks!
December 15, 2005 at 5:12 am
No way - experience is what it takes
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply