Update all records in one column with data from the first record in another table

I am  looking to update all the rows of one column in a table with the value in a the first row in a seperate table.
I have tried
UPDATE       InputGlobalFeed
SET                IGFMerchantName = AWHeader.AWMerchantName
FROM            AWHeader CROSS JOIN
                         InputGlobalFeed

But this updates IGFMerchantName from  InputGlobalFeed with various record from AWHeader and not just AWMerchantName.
Many thanks
Simon CrippsOwnerAsked:
Who is Participating?
 
sunithnairCommented:
Try this query

UPDATE InputGlobalFeed
SET IGFMerchantName = (SELECT TOP 1 AWMerchantName FROM AWHeader)
0
 
tigin44Commented:
try this
UPDATE T1
SET T1.IGFMerchantName = T2.AWMerchantName
FROM InputGlobalFeed T1,
	(SELECT TOP 1 AWMerchantName FROM AWHeader) T2

Open in new window

0
 
Simon CrippsOwnerAuthor Commented:
many thanks Sunithnair, thought it was something like this but just could not nail it. Cheers
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.