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
One brass key blank fits a precise profile jig while a similar blank with a different ridge rests outside

LIKE Character Ranges: [a-f], [^0-9] and Collation Traps

August 9, 2011
Pinal Dave
SQL Tips and Tricks
SQL Collation, SQL NULL, SQL String, Unicode

A bracket range sounds simple until the collation decides what sits between a and f. Test it once so a bad code never reaches your table.

Read More
Two identical glasses of water, one with a red drop sinking in it

Rows That Look Identical but Are Not: Finding Hidden Characters

April 1, 2011
Pinal Dave
SQL Tips and Tricks
SQL Collation, SQL Server, SQL String, Unicode

Expose hidden characters with DATALENGTH and UNICODE, clean known whitespace safely, and add a constraint to prevent recurrence.

Read More
Glass bottles on a windowsill arranged tallest to shortest, one short vermilion bottle out of place in the middle.

Sorting Correctly: Collation and ORDER BY

February 10, 2011
Pinal Dave
SQL Tips and Tricks
SQL Collation, SQL NULL, SQL Order By, SQL Server

Collation and ORDER BY decide case, accent, and text-number order; choose rules explicitly when one report needs different sorting.

Read More
Gouache painting: two identical toy trains with red engines and blue carriages standing on one wooden track

Text Equality: Trailing Spaces Can Compare as Equal

January 28, 2011
Pinal Dave
SQL Tips and Tricks
SQL Collation, SQL Datatype, SQL Server

Text equality can match different stored strings. Check byte length and complete representation when exact identity belongs to the contract.

Read More
An open hand holding two nearly identical red ladybirds, one with a single extra small dot.

Accent-Insensitive Searches: Finding Jose and José Together

October 11, 2010
Pinal Dave
SQL Tips and Tricks
Computed Column, SQL Collation, SQL Index, SQL Server

Build accent-insensitive searches with explicit collations, compare case rules, and index a computed search column for consistent lookup.

Read More
Gouache painting: two shallow trays of turned wooden acorns, each holding both large and small acorns

REPLACE With COLLATE: Choose Case Matching Explicitly

September 17, 2010
Pinal Dave
SQL Tips and Tricks
SQL Collation, SQL Function, SQL Server

REPLACE with COLLATE controls which substrings match. Preview case-dependent results before applying a text replacement policy.

Read More
Three leaf-pattern cloth samples mounted together in a wooden frame on a workshop bench.

Multi-Language Text: A Table Design for Translations

May 23, 2010
Pinal Dave
SQL Tips and Tricks
SQL Collation, SQL Table Operation, Unicode

Multi-language text separates product identity from translated names. This test setup checks requested, fallback, and base names, Unicode text, duplicate tags, missing rows, and a precise blank policy.

Read More
Previous 1 2 3 4 5 6 7 8 Next
  • Books
  • Testimonials
  • Privacy Policy

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