DECLARE @mainString NVARCHAR(100)='Rasel Ahmed' IF CHARINDEX('Rasel',@mainString) > 0 -- return boolean: 1 OR 0 BEGIN PRINT('Yes'); END ELSE PRINT('No')