Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mtlmonk
Starting Member
6 Posts |
Posted - 2009-09-23 : 16:07:03
|
| Hello,In a stored procedure, how can you check that a string is inside another?I'm not doing this through a query but in the code of the stored procedure.I need to find out if a string variable is present inside another variable.DECLARE @part AS VARCHAR(10)DECLARE @wholeword AS VARCHAR(10)if "@part is inside of @wholeword" print 'is inside'else print 'is not inside' |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-09-23 : 16:40:25
|
| if charindex(@part, @wholeword) > 0Be One with the OptimizerTG |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-09-24 : 02:30:51
|
| orif @wholeword like '%'+@part'%'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|