Solved

Query Text

Posted on 2011-03-08
5
261 Views
Last Modified: 2012-05-11
Hi Experts!

Say I needed to look through 500K flat files (each no larger than 3KB)
So, I created a table (Msg_tbl) with a feild called "msgtxt" as a text field.

The idea is to load each file into the table.

How do you query the field "msgtxt" if you want to find phrases such as "out of the blue"?

This is for SQL 2008.

TIA
0
Comment
Question by:allanau20
  • 3
5 Comments
 
LVL 32

Assisted Solution

by:ewangoya
ewangoya earned 50 total points
ID: 35073431

use LIKE

select msgtxt  
from Tablename
where msgtxt LIKE '%out of the blue%'
0
 
LVL 5

Author Comment

by:allanau20
ID: 35073607
ok; just like for char or varchar fields then.
I'll try once I've loaded all the files. Thx!
0
 
LVL 50

Accepted Solution

by:
Lowfatspread earned 450 total points
ID: 35073970
are you wanting to search for '%out of the blue%' or are you looking for similar phrases, phrases with the same.similar meaning?

 in which case you nmay wish to consider establishing a fulltext index over the column and using the full text search keywords
e.g. contains....


if you are trying to do a "LIKE" search do you need to worry about punctuation between the words of the phrase?
0
 
LVL 5

Author Comment

by:allanau20
ID: 35074324
Thx Lowfatspread. full text search sounds like what I"m looking for.
I'll try to google up some example. Thx!
0
 
LVL 5

Author Comment

by:allanau20
ID: 35087349
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

910 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

23 Experts available now in Live!

Get 1:1 Help Now