Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Posts
    176

    Unanswered: NOOPS in SQL query

    Hello DBA's:

    I need to exclude some words while doing a string comparison to get a good result. I do not need words like The, Of, And, In while comparing two strings. In short the record

    The ABC Company OF XYZ

    should match with BOTH

    1. ABC
    2. Company XYZ

  2. #2
    Join Date
    Sep 2003
    Location
    Dallas, Texas
    Posts
    311

    Re: NOOPS in SQL query

    Could you give us a bit more info of what you wanted to do? Or post your query if you can?

  3. #3
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    You could use function replace() for deleting all 'noise' words. List of 'noise' words you can find \Mssql\Ftdata\Sqlserver\Config if Full-Text Search is installed.

  4. #4
    Join Date
    Dec 2003
    Location
    India
    Posts
    3

    Thumbs up

    You can use the full text search feature of MS Sql server to do this kind of search operations.

  5. #5
    Join Date
    Dec 2003
    Posts
    3

    Lightbulb

    Have you looked into using the 'CONTAINS' clause?

    You can do something like:

    SELECT CompanyName
    FROM Companies
    WHERE CONTAINS(CompanyName, ' "ABC" OR "company" NEAR "XYZ" ')
    GO

    (You have to have FullText Indexing turned on for this to work)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •