set @ExpressionToSearch ='%blah hello%'
set @ExpressionToFind ='[%]'print len(@ExpressionToSearch)
print substring(@ExpressionToSearch,1,1)
print substring(@ExpressionToSearch,2,len(@ExpressionToSearch))
print substring(@ExpressionToSearch,len(@ExpressionToSearch),1)
print substring(@ExpressionToSearch,1,len(@ExpressionToSearch)-1)
IF @ExpressionToSearch LIKE '%' + @ExpressionToFind + '%'
PRINT 'Yes it Contains'if substring(@ExpressionToSearch,1,1)='%'
print 'first'
if substring(@ExpressionToSearch,len(@ExpressionToSearch),1)='%'
print 'last'
ELSE
PRINT 'It doesn''t Contain'
Links
stackoverflow
sqlhints
No comments:
Post a Comment