I would like to create function on sql server to check in string values .
pass to two parameters first original '12.33.44.65.22'
, second '44.22'
and return
true
if parameter2
is found in original parameter
ex :
call fun1('22.34.56.78' , '23.24') -- return false
call fun1('22.34.56.78' , '23.24') -- return false
call fun1('22.34.56.78.43.76' , '22.12') -- return false , because should be both exists
call fun1('22.34.56.78' , '22.56') -- return true
call fun1('21.34.56.54' , '21.56') -- return true
call fun1('21.34.56.54' , '34.56') -- return true
call fun1('22.34.56.78' , '34.55.35') -- return false
Thanks.
See Question&Answers more detail:os