Friday, February 24, 2012

CONTAINS

Hi,
I would like to perform a search which returns records that are like a
string variable I pass into the query - so to catch spelling mistakes etc.
Eg. string = Commmercial would return Commercial from my reference table.
Could someone recommend the best way to do this. I am using VB.NET and
ADO.NET to execute my sql statement.
Should I use a WHERE CONTAINS clause. If so how does one enable full-text
indexed? I always get this error even using Northwind. "Cannot use a
CONTAINS or FREETEXT predicate on table 'mytable' because it is not
full-text indexed."Have a look at the SOUNDEX command, it may help.
Peter
"11Oppidan" wrote:

> Hi,
> I would like to perform a search which returns records that are like a
> string variable I pass into the query - so to catch spelling mistakes etc.
> Eg. string = Commmercial would return Commercial from my reference table.
> Could someone recommend the best way to do this. I am using VB.NET and
> ADO.NET to execute my sql statement.
> Should I use a WHERE CONTAINS clause. If so how does one enable full-text
> indexed? I always get this error even using Northwind. "Cannot use a
> CONTAINS or FREETEXT predicate on table 'mytable' because it is not
> full-text indexed."
>
>|||Thanks Peter - thats great!
"Peter 'Not Peter The Spate' Nolan"
<PeterNotPeterTheSpateNolan@.discussions.microsoft.com> wrote in message
news:23F80AF0-26B9-48F4-9501-290999F78877@.microsoft.com...
> Have a look at the SOUNDEX command, it may help.
> Peter
> "11Oppidan" wrote:
>

No comments:

Post a Comment