I would like to know how I can use local variables in CASE statements in SQL?
CASE
This script gives me an error:
DECLARE @Test int; DE
DECLARE @Test int; SET @Test = 10; SELECT CASE @Test WHEN 10 THEN 'OK test' END
For SQL server 2005