Link to home
Start Free TrialLog in
Avatar of chuang4630
chuang4630

asked on

What is the easiest way to test if a target string 'ABC' is in the source string @sourceString?

What is the easiest way to test if a target string 'ABC' is in the source string @sourceString?

This is for SQL 2005
ASKER CERTIFIED SOLUTION
Avatar of appari
appari
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
if you want to use it in where clause of select/update/delete commands use it like

select * from yourtablename
where sourceColumn like '%ABC%'
Avatar of chuang4630
chuang4630

ASKER

SQL gives me the error at this line

if (@PONumber like '%-PF-%')

I got it. Thanks