Solved

UPDATE ERROR - WITH MS SQL SERVER

Posted on 2011-03-03
1
181 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

895 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now