Home Forums Article Discussions Article Discussions by Author Discuss content posted by NT CASE vagaries RE: CASE vagaries
Carlo Romagnano
SSC-Insane
Points: 22597
More actions
September 9, 2013 at 3:45 am
#1648479
Maybe, the author exchanged the CAST and the ISNULL:
The right version:
DECLARE @x CHAR(1)
SET @x = CASE
WHEN @x = 'x' THEN 1
END
PRINT '@X is now ' + ISNULL(CAST(@x AS VARCHAR(50)), 'A NULL') + '<'