views:

464

answers:

1

Hello,

I have a question regarding a CONTAINSTABLE function. I would like to find everything that ENDS WITH the search string.

I can use the * to find everything that starts with the searchvalue, but I want an equivalent for the % sign in the SQL LIKE function.

What I want: find everything that ends with 123, so as searchvalue, I could use "*123" in my CONTAINSTABLE function. But that doesn't work..

If I want all results starting with 123, I use "123*", and that works well.

But what's the equivalent for --> LIKE %123 ?? it isn't "*123" in the CONTAINSTABLE function. What is it then?

Thanks!

A: 

Unfortunately, SQL Server fulltext search does NOT support searching for expression with a leading "%" - tried that myself, but it's just not supported.

You can search for CONTAINS( "expression%" ) - but not for CONTAINS( "%postfix" ).

Marc

marc_s
Thanks Marc,Is there a solution which uses full-text search for a searchvalue "ends with"?
No, not at this time, unfortunately. Your only option would be to use another product (like Lucene.NET) instead of SQL Server's built-in fulltext search
marc_s