Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Update (Case When)



Permlink Replies: 0
Melissa Torn

Posts: 143
Registered: 4/30/09
Update (Case When)
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 13, 2018 12:12 AM
Is that possible to update a table with Case When with
a single Query without a S.Proc ?
Below query returns error msg= Token Unknown CASE

UPDATE MYTABLE
CASE
WHEN TOTAL < 0 THEN
SET CREDIT=TOTAL * -1 , TOTAL=TOTAL * -1 ELSE
SET CREDIT=TOTAL
END
DEBIT=0 WHERE TCODE='01'

Thank You
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02