Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

Query Text

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
allanau20
Asked:
allanau20
  • 3
2 Solutions
 
Ephraim WangoyaCommented:

use LIKE

select msgtxt  
from Tablename
where msgtxt LIKE '%out of the blue%'
0
 
allanau20Author Commented:
ok; just like for char or varchar fields then.
I'll try once I've loaded all the files. Thx!
0
 
LowfatspreadCommented:
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
 
allanau20Author Commented:
Thx Lowfatspread. full text search sounds like what I"m looking for.
I'll try to google up some example. Thx!
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now