Hi, how to use LIKE in CASE statement, i have got this example script but does not work. I use MS SQL 2008
DECLARE
@DataBaseName sysname,
@Message char(255)
SET @DataBaseName = 'DBa';
SET @Message =
CASE @DataBaseName
WHEN LIKE 'DBa'
THEN 'Valid name'
ELSE 'INVALID name'
END
Print @Message;