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
Solved

Query Text

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

856 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