Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Full-Text Search / January 2007

Tip: Looking for answers? Try searching our database.

Search string with percent sign %

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John S. - 29 Jan 2007 16:00 GMT
We have a database full of grocery items that we're trying to search. When I
search for "*1%*" it seems that the percent sign is ignored and I get back
all the rows that match "*1*" (which is A LOT). Is there anyway I can tell
full-text search not to discard the percent sign and treat "1%" as a word?
John S. - 29 Jan 2007 16:04 GMT
i should mention this is Sql 2000 on Win2k

> We have a database full of grocery items that we're trying to search. When I
> search for "*1%*" it seems that the percent sign is ignored and I get back
> all the rows that match "*1*" (which is A LOT). Is there anyway I can tell
> full-text search not to discard the percent sign and treat "1%" as a word?
Simon Sabin - 29 Jan 2007 22:33 GMT
Hello John S.,

Try LIKE '*1[%]*'

This is explained in BOL

Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons

> i should mention this is Sql 2000 on Win2k
>
[quoted text clipped - 3 lines]
>> there anyway I can tell full-text search not to discard the percent
>> sign and treat "1%" as a word?
John S. - 30 Jan 2007 00:34 GMT
Hi Simon,
I also forgot to mention that I need to do this with CONTAINSTABLE.

> Hello John S.,
>
[quoted text clipped - 13 lines]
> >> there anyway I can tell full-text search not to discard the percent
> >> sign and treat "1%" as a word?
Simon Sabin - 30 Jan 2007 11:22 GMT
Hello John S.,

I don't think you can as % is considered an ignored character.

In addition you can't do searches with a preceeding wild card

"*simon" is not valid whilst "simon*" is.

Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons

> Hi Simon,
> I also forgot to mention that I need to do this with CONTAINSTABLE.
[quoted text clipped - 15 lines]
>>>> LOT). Is there anyway I can tell full-text search not to discard
>>>> the percent sign and treat "1%" as a word?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.