farrukhhameed786 (1/28/2015)
HiHow to do this?
Without seeing the code you have already written which would help to describe your problem, it would have to be a guess. Something like
UPDATE MyTable SET
column1 = CASE WHEN AnotherColumn = 1 THEN 'Yes' ELSE 'No' END,
column2 = CASE WHEN AnotherColumn = 2 THEN 23 ELSE NULL END
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden