Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TSQL equiv of str$str without full text indexing
Message
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01528654
Message ID:
01528657
Views:
47
>Hi Charles,
>
>>I know how to use CONTAINS when full text indexing is on but is there a way to find all records containing '[ISO]' in a varchar(1500) column without it?
>
>You can use LIKE operator
>
>VarcharColumn LIKE '[[]ISO]' 
>-- or
>VarcharColumn LIKE '\[ISO]' ESCAPE '\'
>
>
>
>>
>>And what would be the syntax equiv to STRTRAN(mycolumn,'[ISO]','') ?
>
>and REPLACE() function here
>
>REPLACE(yourcolumn,'[ISO]','')
>
Minor correction in the above:
VarcharColumn LIKE '%[[]ISO]%' 

-- OR

or
VarcharColumn LIKE '%\[ISO]%' ESCAPE '\'
See also CHARINDEX and PATINDEX functions, though in WHERE clause you want to use LIKE. Although if you want to search for an expression anywhere in the string, LIKE '%' + pattern + '%' is not optimized.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform