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 grain sampling spear holding a small sample beside a full grain sack

rows_sampled: Checking How Much Data Your Statistics Saw

April 23, 2021
Pinal Dave
SQL Performance
Data Warehousing, Master Data Services, SQL Data Storage, SQL Statistics

A fresh statistic can still come from a small sample. Compare rows with rows_sampled and see how a sample misjudges a rare value.

Read More
A wire stripper beside a transformed cable section and its removed outer sleeve

Masking Test Data With REGEXP_REPLACE in SQL Server 2025

April 13, 2019
Pinal Dave
SQL Tips and Tricks
Data Visualization, Data Warehousing, Master Data Services, SQL Data Storage

Before a production copy reaches a developer, replace the real emails and phone numbers. Here is a small, checked way to do it with REGEXP_REPLACE.

Read More
Ice tongs lifting a cube from one side of a fixed trough divider

Recent Rows Only: A Filtered Index for the Data Everyone Reads

March 21, 2019
Pinal Dave
SQL Performance
Data Warehousing, Master Data Services, SQL Data Storage, SQL Index

A filtered index for recent rows is small and fast, but its date never moves by itself. Here is how to build it, test it and keep it fresh.

Read More
Fine wax bead from a copper canting beside a broad hardened wax bead

The money Data Type: Where Division and Rounding Go Wrong

October 10, 2017
Pinal Dave
SQL Tips and Tricks
Data Visualization, Data Warehousing, Master Data Services, SQL Data Storage

Dividing money by money loses digits before any cast can save them. Here is the one-third demo, and how to find the leftover penny.

Read More
Scarf fringe with both tied and untied threads visible

Building a Data Dictionary Query From Extended Properties

September 29, 2017
Pinal Dave
SQL Tips and Tricks
Data Warehousing, Master Data Services, SQL Data Storage, SQL Extended Events

A plain join quietly hides every column nobody described. See the LEFT JOIN that keeps them, and turn the gaps into a to-do list.

Read More
Compact paint spray gun connected by twin hoses to a separate pigment pressure pot

Out-of-Row Storage for varchar(max): Keeping Data Pages Small

October 3, 2016
Pinal Dave
SQL Tips and Tricks
Data Visualization, Data Warehousing, Master Data Services, SQL Data Storage

Turn on the out-of-row option and nothing happens until you rewrite the data. I measure pages and reads at each step so you can see the real trade.

Read More
Distinct sea urchin shells with matching spines and one empty cavity

FOR JSON Data Types: How bit, Dates and Money Come Out

August 30, 2016
Pinal Dave
SQL Tips and Tricks
Data Warehousing, JSON, Master Data Services, SQL Data Storage

Your API returns 1 and the client wanted true. Here is how FOR JSON picks a JSON type for bit, dates, decimal, money, binary and NULL, and how to fix it.

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

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