This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Mixed bottles in a crate beside a sorted wooden wine rack, with three wax-sealed amber bottles drawn out together

Word Search Without Full-Text: Build a Word Index Table

May 6, 2012
Pinal Dave
SQL Tips and Tricks
SQL Index, SQL Search, SQL String

LIKE with a leading wildcard reads the whole table. A small side table of words turns that scan into a quick lookup, and you do not need full-text installed.

Read More
Table of eight shop names with the character code of each apostrophe and whether LIKE found it. Three straight marks, code 39, were found. Two curly marks, code 8217, were not found

Finding Apostrophes in SQL Server Text: Straight and Curly

August 3, 2011
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Search, SQL String, Unicode

Finding apostrophes in SQL Server text takes one trick and one trap. The trick is doubling the quote inside a LIKE pattern. The trap is that text can hold a curly apostrophe, and the usual search skips it. This post tests both on a table of eight shop names.

Read More
Three LIKE symbols shown as cards: percent sign, underscore and open bracket, each with the number of rows that contain it next to the number of rows LIKE found, and a row of plain symbols whose counts matched

Special Characters in a LIKE Pattern: Which Ones Are Wildcards

August 2, 2011
Pinal Dave
SQL Tips and Tricks
SQL Operator, SQL Scripts, SQL Search, SQL String

Special characters in a LIKE pattern can match the wrong rows, because three symbols mean more than themselves. This post tests every common symbol on one small table. It shows how to search for a percent sign, an underscore and a bracket, and why a space in the pattern counts.

Read More
Four LIKE wildcards with a real example each: percent matches Baker and Brooks for B percent, underscore finds Baker, Patel and Taylor for underscore a percent, [A-K] returns five names, and [^A-K] returns nine

Wildcard Basics in SQL Server: How LIKE Patterns Work

August 1, 2011
Pinal Dave
SQL Tips and Tricks
SQL Operator, SQL Scripts, SQL Search, SQL String

Wildcard basics for SQL Server: how LIKE works with %, _, sets and ranges, shown on one small table of last names. It also covers the mistakes with equal signs and sets, case and accents in ranges, and matching a wildcard literally. Every result comes from SQL Server 2025.

Read More
Two nearly identical brass keys lying side by side on a workbench, one cut with a single notch in a different place.

SQL SERVER – Collate – Case Sensitive SQL Query Search

April 30, 2007
Pinal Dave
SQL Tips and Tricks
SQL Collation, SQL Scripts, SQL Search, SQL Server, SQL Utility

Make a SQL Query Search case sensitive: add COLLATE Latin1_General_CS_AS to the WHERE clause so ‘casesearch’ matches one row instead of all four.

Read More
Previous 1 2
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com