Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 457945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:37:19+00:00 2026-05-12T22:37:19+00:00

We have a a few queries in our system that use LIKE ‘%’+@SomeCriteria+’%’ to

  • 0

We have a a few queries in our system that use LIKE ‘%’+@SomeCriteria+’%’ to search a for a person’s name. We are talking VARCHAR(50) fields in this case. We would really like to allow our users the ability to search within names.

The way I understand it, indexing the field will only make this faster if we search for the first part of the name, and full text indexing will search for specific words, but as far as I can tell doesn’t help when searching within words.

Is there a good way in SQL 2008 to efficiently search inside of words for a given criteria without doing a complete table scan? Am I doomed to come up with a complex custom approach or have a consistently slow query?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T22:37:19+00:00Added an answer on May 12, 2026 at 10:37 pm

    What we did one time that helped with the slowness of the query was we had a stored proc that ran two pieces of code instead of one. First we did an exact match search and then only went to the inexact search if the exact one didn’t return results (or in one case if the exact match search returned less than 5 results). That way, users who were willing to type the whole name got a fast response but those who only wanted to type a few characters got a slower one. You could do it with three possibilities as well, exact match, inexact match only on the end and inexact match at front and end.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have ran across a few queries that use this where condition: select ...
We have couple of tables, most of our queries use just a few joins,
I have a few complex queries that are ran very often. Caching the results
We have a query in our system that has been a problem in the
I have some queries that are causing timeouts in our live environment. (>30 seconds)
I have few simple queries, that display rows from a table in a database.
I have prepared few queries using startwith and connectby for fetching all items of
I have a few queries regarding columns in Postgres CSV Log. Query 1 Following
i have few confusion regarding ORM(Object Relational Mapping) i am thinking about to use
I have few text fields like SSN , phone number and email id. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.