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

  • Home
  • SEARCH
  • 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 3626886
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:49:08+00:00 2026-05-18T23:49:08+00:00

Ok, using SQL Server 2008. On my web page I have a textbox with

  • 0

Ok, using SQL Server 2008. On my web page I have a textbox with jQuery-UI AutoComplete hooked up.

Now I need a stored procedure to search across all columns of a single table(or multiple joined tables I suppose) for a search string coming from the textbox/autocomplete AJAX call, and return “suggested” search strings. I am using the AdventureWorks db for testing(Products table)

So for example, the product table has columns for product name and product number(among others) and I want to return suggested search strings based on user input where they may enter a product name and/or a product number.

I have it working across a single column which was simple. Any ideas?

  • 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-18T23:49:08+00:00Added an answer on May 18, 2026 at 11:49 pm

    I’m going to suggest full text search (MS’ or Lucene will work) The code below use MSSQL FTS as its what I use in my app at the moment.

    Install FTS Search if you haven’t already. If you have check the service is running.
    In management studio run this to setup a catalog and add the products table; and Color / Name / Product Number to the catalog.

    USE [AdventureWorks]
    GO
    CREATE FULLTEXT CATALOG [ProductsTest]WITH ACCENT_SENSITIVITY = OFF
    AUTHORIZATION [dbo]
    
    GO
    
    USE [AdventureWorks]
    GO
    CREATE FULLTEXT INDEX ON [Production].[Product] KEY INDEX [PK_Product_ProductID] ON ([ProductsTest]) WITH (CHANGE_TRACKING AUTO)
    GO
    USE [AdventureWorks]
    GO
    ALTER FULLTEXT INDEX ON [Production].[Product] ADD ([Color])
    GO
    USE [AdventureWorks]
    GO
    ALTER FULLTEXT INDEX ON [Production].[Product] ADD ([Name])
    GO
    USE [AdventureWorks]
    GO
    ALTER FULLTEXT INDEX ON [Production].[Product] ADD ([ProductNumber])
    GO
    USE [AdventureWorks]
    GO
    ALTER FULLTEXT INDEX ON [Production].[Product] ENABLE
    GO
    

    You can then run queries against all columns at once; e.g. Silver (Chosen as its in color and Name)

    Select * from production.product where
    contains(*, '"Silver*"')
    

    The * on the query will find Silver* so you can use this to build up results as the user types in. One thing to consider is that google make this work in real time – if you are searching a lot of data you to be able to get the data back without interrupting the typing of the user. i think generally people use these searches by typing from the first letter they are looking for – i accept there will be spelling mistakes- you could implement a spell checker after every space they press perhaps to handle that. Or store the searches that are run and look at the mispellings and change the code to handle that based on a mapping (or in FTS using a custom thesaurus.)

    Ranking is going to be a fun development issue to any business; are you finding the first result for Mountain Frame -or do you want to weight them by sales or price? If the user types in more than one text term you can use FTS to produce a ranking based on the search string.

    select aa.rank, bb.* 
    From containstable(production.product, *, '"Mountain" and "Silver*"') aa
    inner join production.product bb
    on aa.[key] = bb.productid
    order by rank desc
    

    This returns 30 rows; and weights based on the user inputted text to determine the first place record. In either case you will likely want to add a coded ranking to tweak the results to suit your business desires – ranking te highest priced widget 1 might not be the way. That is why you are going to store what people searched for / clicked on so you can analyse the results later.

    There is a really nice language parser for .Net that translates a google style string query inputted into FTS’able language which gives familiarity for any boolean searches that use your site.

    You may also want to add some wisdom of crowds features by auditing against what users have input and ultimately gone to visit and use success maps to alter the final suggestions to actually make them relevant to the user.

    As a final suggestion if this is a commercial website you might want to look at Easyask which is a scary great natural language processor

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

Sidebar

Related Questions

I'm using SQL Server 2008 Management studio viewing a 2005 server and have just
I am using SQL Server 2008 Web Edition and it seems my SQL queries
Using SQL Server 2008, I have a requirement that email addresses in my user
I built this app with Web Developer Express 2010 using SQL Server Express 2008.
I have an ASP.NET MVC Web Application that interacts with a SQL Server 2008
I'm using SQL Server 2008 with Advanced Services on my Vista Home Premium. I'd
I'm using SQL Server 2008. My database is almost 2GB in size. 90% of
Like: insert into table (col) values (N'multilingual unicode strings') I'm using SQL Server 2008
I am using SQL Server Reporting Services 2008 (though this seems to be an
I am looking to manage a SQL Server 2008 DB using Management Studio 2005.

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.