Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • 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.

  • 3
2 Solutions
Ephraim WangoyaCommented:

use LIKE

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

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

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