Link to home
Start Free TrialLog in
Avatar of GlobaLevel
GlobaLevelFlag for United States of America

asked on

UPDATE ERROR - WITH MS SQL SERVER

I cant figure out whats wrong with this update statement...

declare @Resell_program table (TC_ID nvarchar(max), ind_1x_res_id nvarchar(max),ind_1x_res_product nvarchar(max), ind_1x_res_current nvarchar(max),ind_1x_res_SUB_TOTAL nvarchar(max) ,ind_1x_res_TOTAL nvarchar(max))
insert into @Resell_program (TC_ID,ind_1x_res_id,ind_1x_res_product,ind_1x_res_current,ind_1x_res_SUB_TOTAL,ind_1x_res_TOTAL)
values ('TC_ID_SD9FJG3K','IR_1X_WEDR5T','PRO','YES','','')
SELECT * FROM @Resell_program

UPDATE RS
SET ind_1x_res_SUB_TOTAL CASE =
WHEN ind_1x_res_product = 'PRO' THEN '1'
WHEN ind_1x_res_product = 'H' THEN '8'
END
FROM @Resell_program RS
WHERE TC_ID = 'TC_ID_SD9FJG3K'
ASKER CERTIFIED SOLUTION
Avatar of knightEknight
knightEknight
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial