Refresh entire single column with joined table query

I have a table in which I just added a column, and now I'm trying to find an easy way to update it.

select * from KioskGoals kg inner join [TestDB].dbo.Kiosks k on kg.kioskID = k.Id 

The joined table has the names I need. I want to update the KioskGoals table and set the column kioskName = name returned from [TestDB].dbo.Kiosks , which will be k.name

Is this possible with a single request?

The table to be updated is KioskGoals . The column to update is kioskName .

+7
sql-server tsql
source share
1 answer
 UPDATE kg SET Kg.kioskName = K.name from KioskGoals kg inner join [TestDB].dbo.Kiosks k on kg.kioskID = k.Id 
+7
source share

All Articles