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
A gardener lifting white frost covers one by one along a vegetable row on a frosty morning.

SARGable Date Filters: Stop Wrapping Columns in Functions

October 5, 2012
Pinal Dave
SQL Performance
SQL DateTime, SQL Function, SQL Index, SQL Performance, SQL Server

Write SARGable date filters as half-open ranges for years, months, days, and rolling windows, then compare plans and logical reads.

Read More
SQL SERVER - Preserve Leading Zero While Coping to Excel from SSMS

SQL SERVER – Preserve Leading Zero While Coping to Excel from SSMS

September 30, 2012
Pinal Dave
SQL Tips and Tricks
Excel, SQL Function, SQL Server

Want to preserve leading zero values when you paste SSMS results into Excel? The fix is in Excel: format the cells as Text first, and the zeros stay.

Read More
A tall boot beside a small open shoebox that holds only a small red paper star instead of the boot.

Why CAST to a Short VARCHAR Returns a Star Instead of an Error

September 20, 2012
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Server, SQL String

Understand why a short VARCHAR returns a star for an integer, compare Unicode errors and string truncation, and size conversions safely.

Read More
Similar maracas with different seeds visible through their open plugs

Fuzzy Name Matching With SOUNDEX and DIFFERENCE

September 10, 2012
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server

SOUNDEX and DIFFERENCE can surface duplicate customers, and they can also flag people who only sound alike. Here is how I keep the review honest.

Read More
Gouache painting of a tray of mixed buttons on a sewing table, with a few matching vermilion buttons set apart in a small dish.

REGEXP_COUNT in SQL Server 2025: Counting Pattern Matches in Text

August 25, 2012
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL String

REGEXP_COUNT counts how many times a pattern matches inside a text value, a job that used to need LEN and REPLACE tricks. This post tests it on SQL Server 2025: start position, flags, NULL and empty text, a data quality check, and where the old trick still fits.

Read More
A strip of stitched buttonholes shows distinct gaps between successive openings in cream cloth

Measuring Time Between Workflow Steps With LEAD

August 15, 2012
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Order By, SQL Reports

Status rows hold timestamps, not durations. I use LEAD to measure each step, keep unfinished steps NULL, and show why zero ruins your averages.

Read More
A harmonica exposes separate chambers from one end, with a small vermilion accent on its casing

PARSENAME for Dotted Values: Build Numbers and Object Names

July 29, 2012
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Instance, SQL Order By, SQL String

Why does revision 12 sort before 7? Because the parts are text. Here is how PARSENAME fixes it, and where it trips you up.

Read More
Previous 1 … 34 35 36 37 38 39 40 … 92 Next
  • Books
  • Testimonials
  • Privacy Policy

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