Update bo_LicenceGert Ta bort "L." så borde det funka (du har ju redan sagt vilken tabell du vill uppdatera i så...) Borde se ut så här:UPDATE i MS SQL
set L.OldHcp = S.AverageHcp
FROM Svbf_Licence S
left outer join bo_LicenceGert L ON(L.LicNbr = S.LicNbr)
WHERE L.Inactive = 0 AND L.OldHcp < 0
jag får följande error:
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "L.OldHcp" could not be bound.
Vad har jag missat?Sv: UPDATE i MS SQL
UPDATE bo_LicenceGert
SET OldHcp = S.AverageHcp
FROM Svbf_Licence S
LEFT OUTER JOIN bo_LicenceGert L ON(L.LicNbr = S.LicNbr)
WHERE L.Inactive = 0 AND L.OldHcp < 0
Sv: UPDATE i MS SQL
<code>
UPDATE bo_LicenceGert
SET OldHcp = S.AverageHcp
FROM bo_LicenceGert L
LEFT OUTER JOIN Svbf_Licence S ON (L.LicNbr = S.LicNbr)
WHERE (L.Inactive = 0) AND (L.OldHcp < 0);
</code>