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
 merging data

Author  Topic 

newbie-togo
Starting Member

1 Post

Posted - 2011-11-01 : 07:56:28
Hi I have two tables which have a common "filename" field

one of the tables has a "Caption" field which is populated, the other has a "Caption" field that is not populated.

How can I quickly run through and drag the caption data from one table and put it into the other where the filename matches.

I hope that makes sense.

I am using MS Sql 2005

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-11-01 : 08:05:53
update t1
set Caption = t2.Caption
from table1 as t1
join table2 as t2
on t1.filename = t2.filename


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -