How to use a LIKE statement inside an IF statement?
- by user322652
I need to be able to check if a variable has a certain string of text inside it. Here's what I have now:
--This sample always goes to the ELSE block.
IF( @name LIKE '%John%' )
BEGIN
--do one thing
END
ELSE
BEGIN
--do the other thing
END