How to update rows based on multiple tables in SQL Server Compact Edition?
I have two tables in the database. ActivatedProducts and DocumentSettings.I added a new column (UID) to the DocumentSettings table, I want to put this UID data from the ActivatedProducts (ID) table in relation to ProductID from the ActivatedProducts table.
The following query also does not work, please help me
UPDATE DocumentSettings
SET UID =
(
SELECT ActivatedProducts.ID
FROM ActivatedProducts
WHERE DocumentSettings.TitleID = ActivatedProducts.ProductID
)
UPDATE A
SET A.UID = B.ID
FROM DocumentSettings A, ActivatedProducts B
WHERE A.TitleID = B.ProductID
UPDATE DocumentSettings
SET [UID]=AP.[ID]
FROM DocumentSettings DS
INNER JOIN ActivatedProducts AP ON DS.[Titleid]=AP.[ProductID]
source
share