Solved

Query Text

Posted on 2011-03-08
5
256 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

757 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