Hi, I am studying SQL, I would like to know how can I use local variables in CASE statements in SQL. Thanks guys for your help. This script gives me error:
DECLARE @Test int;
DECLARE @Result char(10);
SET @Test = 10;
CASE @Test
WHEN @Test = 10
THEN SET @Result='OK test'
END
Print @Result;
I USE MS SQL 2008