Full Text Searching with MS SQL Reference Table

Listed below is the syntax table used for full-text searching with an MS SQL database. All searching is case insensitive. Additionally, all single letters and numbers, as well as “noise” words such as “well,” “or,” “and,” “etc.,” are automatically excluded from searches.

Type of Search

Examples

Simple words

photos

 

Phrase search

“Zasio Enterprises”

Illegal search. The database does not understand whether both terms are required to be present or simply one or the other. It is also unclear whether the terms must be together or anywhere within the text. Use a Boolean (AND/OR/AND NOT), Phrase or Wildcard search instead.

dog cat

AND

All words in search must be present to match.

photos AND digital

OR

Any word in search can be present to match.

photos OR photography

AND NOT

All entries with the word “photos” but not the word “digital” will be found.  Cannot use NOT by itself.

photos AND NOT digital

Returns all “photo”, “photo shop”, “photography”, etc. Without the quotes, it looks for exact occurrences of photo* (including the asterisks).

“photo*”

photo*

Returns all “ice cream”, “iced cream”, “ice creamy”. Wildcard characters can be used in query expressions to expand word searches into pattern searches. The asterisk wildcard (*) specifies that any characters can appear in multiple positions represented by the wildcard. The presence of quotes around the items is significant.

“ice cream*”

 

Form searching. Returns all forms of “dry” such as “drying”, “dried”.

formsof(inflectional,“dry”)

 

Use the NEAR, ~ operator to return results based on the proximity of two or more query terms.

dog NEAR cat

dog ~ cat

Combinations

“Idaho Photography” AND digital

“photo*” AND NOT digital

Grouped by ()

digital AND (“photo*” OR “pict*”)

Punctuation such as single quotes and dashes that are significant characters in a word must be included when searching. Single quotation marks must be accompanied by a second single quote. This example will find “O’Conner”.

O’’Conner

 

Returns “Johnson” or “Johnson?” – The ? is insignificant to the word and is ignored.

Johnson

Returns “123-4567”, but not “123-4567-08”.

123-4567

Returns “123-4567” or “123-4567-08”, but not “123-45678”. The dash is ignored (does not apply to all punctuation).

“123 4567”

 

Returns “123-4567”, “123-45678”, “123-4567 A01”, or “123-4567-08”.

“123-4567*”

Related Topics