WildCard Alternatives.

  • Hi,

    I'm aware that using a wildcard on both sides of a search criteria will stop the index being used, because of the first %:

    e.g. Select * from person where surname = %JONES%.

    Is there any alternative to this (I cant just use one side). ?

    Thanks.

  • full text search

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • ggjjbb1983 (5/9/2012)


    Hi,

    I'm aware that using a wildcard on both sides of a search criteria will stop the index being used, because of the first %:

    e.g. Select * from person where surname = %JONES%.

    Is there any alternative to this (I cant just use one side). ?

    Thanks.

    BTW. Your select statement will use index, if you have one on surname column!

    Wildcard only works with LIKE...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • So, there is no option other than Full Text?

  • Actually, there are!

    You can use other technologies for text searches eg. Lucene for example.

    It's very hard to suggest anything particular without knowing your system architecture details, requirements and your flexibility in options.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply