Solved

UPDATE ERROR - WITH MS SQL SERVER

Posted on 2011-03-03
1
186 Views
Last Modified: 2012-05-11
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'
0
Comment
Question by:GlobaLevel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 33

Accepted Solution

by:
knightEknight earned 500 total points
ID: 35029412
You have:

  SET ind_1x_res_SUB_TOTAL CASE =

should be:

  SET ind_1x_res_SUB_TOTAL = CASE
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question