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 30503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T13:27:29+00:00 2026-05-10T13:27:29+00:00

I have lots of article store in MS SQL server 2005 database in a

  • 0

I have lots of article store in MS SQL server 2005 database in a table called Articles-

'Articles (ArticleID, ArticleTitle, ArticleContent)' 

Now I want some SP or SQL query which could return me similar Article against any user’s input (very much like ‘Similar Posts’ in blogs OR ‘Related Questions’ in stackoverflow). The matching should work on both ArticleTitle and ArticleContent. The query should be intelligent enough to sort the result on the basis on their relevancy.

Is it possible to do this in MS SQL Server 2005?

  • 1 1 Answer
  • 3 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. 2026-05-10T13:27:30+00:00Added an answer on May 10, 2026 at 1:27 pm

    Something like this might work, a kind of ranking system. You would probably have to split the string in your application to build a SQL string, but I have used similar to build an effective site search.

    Select Top 10 ArticleID, ArticleTitle, ArticleContent From Articles Order By (Case When ArticleTitle = 'Article Title' Then 1 Else 0 End) Desc, (Case When ArticleTitle = 'Article' Then 1 Else 0 End) Desc, (Case When ArticleTitle = 'Title' Then 1 Else 0 End) Desc, (Case When Soundex('Article Title') = Soundex(ArticleTitle) Then 1 Else 0 End) Desc, (Case When Soundex('Article') = Soundex(ArticleTitle) Then 1 Else 0 End) Desc, (Case When Soundex('Title') = Soundex(ArticleTitle) Then 1 Else 0 End) Desc, (Case When PatIndex('%Article%Title%', ArticleTitle) > 0 Then 1 Else 0 End) Desc, (Case When PatIndex('%Article%', ArticleTitle) > 0 Then 1 Else 0 End) Desc, (Case When PatIndex('%Title%', ArticleTitle) > 0 Then 1 Else 0 End) Desc, (Case When PatIndex('%Article%Title%', ArticleContent) > 0 Then 1 Else 0 End) Desc, (Case When PatIndex('%Article%', ArticleContent) > 0 Then 1 Else 0 End) Desc, (Case When PatIndex('%Title%', ArticleContent) > 0 Then 1 Else 0 End) Desc 

    You can then add/remove case statements from the order by clause to improve the list based on your data.

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

Sidebar

Related Questions

If I have large articles that need to be stored in a database, each
If I have a string in a div <div id=article> lots of text goes
I have just read through lots of articles about how to create thumbnail screenshots
I have been reading lots of articles and also questions here on SO but
I have read lots of articles on Ant that explain all sorts of options,
I've read lots of articles that condemn the excessive use of divs. I have
I have lots of unrelated named things that I'd like to do quick searches
I have lots and lots of data in various structures. Are there any better
We have lots of logging calls in our app. Our logger takes a System.Type
I have lots of home directories under /ifshome on Linux. I want to see

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.