How to write a T-SQL statement to do a wild card search for strings that containing underscore? 
Author Message
 How to write a T-SQL statement to do a wild card search for strings that containing underscore?
Hi all,
I tried to do a wildcard search for strings that
containing underscore. For example, I want to
search any email that looks

me how should I write the T-SQL statement?
The following T-SQL does not give results that I
want:
Select email from sometable where email like '%
_%' because underscore is a reserved character in
T-SQL when used in wild card search.

Sent via Deja.com
http://www.***.com/



Tue, 01 Jul 2003 06:09:48 GMT
 How to write a T-SQL statement to do a wild card search for strings that containing underscore?

You would use:


Note the square brackets.

--
   Tom

----------------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCT
Columnist, SQL Server Professional

Toronto, ON Canada
www.pinnaclepublishing.com/sql
www.apress.com
---
Hi all,
I tried to do a wildcard search for strings that
containing underscore. For example, I want to
search any email that looks

me how should I write the T-SQL statement?
The following T-SQL does not give results that I
want:
Select email from sometable where email like '%
_%' because underscore is a reserved character in
T-SQL when used in wild card search.

Sent via Deja.com
http://www.deja.com/



Tue, 01 Jul 2003 06:23:34 GMT
 How to write a T-SQL statement to do a wild card search for strings that containing underscore?
Or defining your own escape character like:


Audun
!


Quote:
>You would use:


>Note the square brackets.

>--
>   Tom

>----------------------------------------------------------
>Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCT
>Columnist, SQL Server Professional

>Toronto, ON Canada
>www.pinnaclepublishing.com/sql
>www.apress.com
>---

>Hi all,
>I tried to do a wildcard search for strings that
>containing underscore. For example, I want to
>search any email that looks

>me how should I write the T-SQL statement?
>The following T-SQL does not give results that I
>want:
>Select email from sometable where email like '%
>_%' because underscore is a reserved character in
>T-SQL when used in wild card search.

>Sent via Deja.com
>http://www.deja.com/



Tue, 01 Jul 2003 15:50:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. wild card search

2. Single wild card searching?

3. Wild card Keyword Search using IN vs Like

4. Wild cards search

5. Wild Card in a search

6. character setting for wild card search ?

7. Wild card search

8. SELECT STATEMENT TO SEARCH STRING CONTAINING QUOTES...

9. What is a wild card character in SQL ?

10. Poor Performance when SQL with wild card

11. SQL Wild Cards?

12. TSQL String Constant containing Quotes


 
Powered by phpBB® Forum Software