Using CASE in MS SQL

Code to update a field using “CASE” (instead of using if-then-else):

update
 [dbo].[mytable]
set
 [dbo].[mytable].[title_type]=
 (
 case
 when [title] = 'Baseline' then '0'
 when [title] = 'No Change' then '1'
 else '2'
 end
 );