Wild card search

  • Thread starter Thread starter Dino M. Buljubasic
  • Start date Start date
D

Dino M. Buljubasic

I am trying to simulate wild card search like for example:

cran* would return any word containing 'cran' at the begining
*cran would return any word containing 'cran' at the end
*cran* would return any word containing 'cran' in the middle

Here is whay I am doing but it does not work

SELECT whatever FROM aTable WHERE this = that AND CONTAINS(aColumn,
"cran+%")

I am fetching data from an SQL Server using full text indexing

Any help will be appreciated
 
I am trying to simulate wild card search like for example:

cran* would return any word containing 'cran' at the begining
*cran would return any word containing 'cran' at the end
*cran* would return any word containing 'cran' in the middle

Here is whay I am doing but it does not work

SELECT whatever FROM aTable WHERE this = that AND CONTAINS(aColumn,
"cran+%")

I am fetching data from an SQL Server using full text indexing

Any help will be appreciated
If cran is a variable then shouldn't it be "%" + cran +"%" ?
 
No, "cran" is not a variable. It is the word I am searching for. :)

Ok the contains clause should be (aColumn,"cran*")

I'm not sure that you can do *cran or *cran*.
 
Back
Top