SEL CAST('A'AS CHAR(10));
SEL CASE WHEN 1=1 THEN CAST('A' AS CHAR(10)) ELSE 'Y' END;
The first query gives 'A' followed by 9 spaces.
The Second query gives 'A' and no other spaces suffixed.
What is the reason for this difference in behaviour of cast function in CASE statement