Tuesday, 12 July 2022

MSSQL - Check if varchar contains specified characteer



 


Declare @Test varchar(100) = 'aaa@aaa';


IF @Test Like '%@%'

BEGIN

  print ' contains @'

END

ELSE

BEGIN

print ' doesn''t contain @'

END

1 comment:

  1. This article on checking if a varchar contains a specified character is super helpful! It’s just like using Fira Code for clear and efficient coding—making string operations much more intuitive!






    ReplyDelete