?
Solved

UPDATE ERROR - WITH MS SQL SERVER

Posted on 2011-03-03
1
Medium Priority
?
188 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 2000 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

777 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