[Webinar] Streamline your web hosting managementRegister Today

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

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

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