Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Update field in table from the value of another

Author  Topic 

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2011-10-14 : 10:12:19
How do i go about updating the value of a column in db's table based on another db's table/column? I need to pull the value directly from one to another.

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-10-14 : 10:14:44
update tbl1
set col = tbl2 col
from tbl
join tbl2
on tbl1.colx = tbl2.colx

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2011-10-14 : 10:22:11
Thank you.
Go to Top of Page
   

- Advertisement -