Search by any word!

Posted on 1998-07-20
Last Modified: 2010-03-19
I want to know how to write the SQLQuery that it can search in the table by any word!
Question by:ruisun

Accepted Solution

odessa earned 50 total points
ID: 1091801
very dificult question if you want to search whole table for a word (for example "KILE") do some like this:
select * from TABLE
(FILED1 like "%KILE%") or
(FILED2 like "%KILE%") or
(FILED3 like "%KILE%") ...

. some like this this is the only way

Expert Comment

ID: 1091802
In MSSQL server 7.0 beta you can use full text indexing with
Contains is powerful keyword
This example searches for all products with words of the form "dry": dried, drying, and so on.
(See if you use like dry* over here, it is another story and it returns lot of garbage too)
USE Northwind
SELECT ProductName
FROM Products
I cannot do it with 'like'
also it can use Near() function, wich searches word next to given word
[WHERE CONTAINS(ProductName, 'spread NEAR () Boysenberry']
also uses weighted terms
WHERE CONTAINS(Description, 'ISABOUT (spread weight (.8),
    sauces weight (.4), relishes weight (.2) )' )
See it is simple and powerful, it scrolls every row but
with full text indexing it allows to do sophisticated searches fast, before it was possible only in DB2 and Oracle.
I cannot see we can replace all this examples with LIKE
More in MSSQL 7.0 beta Books Online


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how the fundamental information of how to create a table.

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now