Friday, March 23, 2012

How To Text Search

I purchased a VB SQL 2005 book but it had no info on text searching ( a rewrite of the title of an old book to increase sales). My database is already up and running and I have several text fields of data.

Questions:

Do you need Full-Text searching to search within a text field or does SQL Exp offers basic search?

Can someone post example SELECT statments to search fields for text?

I'm interested in getting exact match and relevance.

Thank you so much.

Refer to Books Online about using the [ LIKE ] keyword, and using WILDCARDs.

For example, to find any row with an occurance of the characters 'FUL' at the beginning of the column:

WHERE MyColumn LIKE 'FUL%'

To find any row with an occurance of the characters 'FUL' anywhere in the column:

WHERE Mycolumn LIKE '%FUL%'

Books Online has many good examples.

In case you don't have a copy of Books Online, you can get your very own copy here.

No comments:

Post a Comment