Now your expression will be encoded (as soon as you add a column reference to the case statement, as mentioned in other posts), however, so that the rest of your syntax is uncommented, this will be a bad service for others in your situation.
, , Update 3 4 ( ).
select #Temp @Table, , .
@table:
declare @OilStatus table (oilDatasetStatusID int)
insert into @OilStatus
select odss.oildatasetstatusid
from OildataSetStatus odss
join oilDataSet ods on ods.OilDataSetID = odss.OilDataSetID
join SamplePoint sp on sp.SamplePointID = odss.SamplePointID
join CustomerSite cs on cs.CustomerSiteID = sp.CustomerSiteID
where cs.CustomerID = 2
update oildatasetstatus
set oildatasetstatusid =
case oildatasetstatusid
WHEN 5 THEN 16
WHEN 6 THEN 17
WHEN 7 THEN 18
WHEN 8 THEN 18
WHEN 9 THEN 18
WHEN 10 THEN 19
WHEN 11 THEN 20
end
where oildatasetlabstatusid in ( select oilDatasetStatusID from @OilStatus )
, , , .
, , , . sql, , , .