Solved

Query Text

Posted on 2011-03-08
5
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 32

Assisted Solution

by:Ephraim Wangoya
Ephraim Wangoya 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
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 documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

734 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