The following query checks weather a string in within another string or not.
DECLARE @part AS VARCHAR(50)
DECLARE @wholeword AS VARCHAR(50)
set @part='to' --The string you want to search
set @wholeword='I need to find'--The string you want to check in
if charindex(@part, @wholeword) > 0
print 'is inside'
else
print 'is not inside'
Simple n Cool ha...!
Wednesday, September 23, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment