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
The real SSMS Spatial results tab next to the query that produced it: 16 lines from the center pin to the grid points exactly the square root of 65 away, each 8.062 units long

Erdős Unit Distance Problem: What It Is and What AI Found

September 29, 2026
Pinal Dave
AI
AI, Mathematics, Spatial Database, SQL Scripts

The Erdős unit distance problem asks how many pairs of points can sit exactly one unit apart. Paul Erdős guessed the answer in 1946, and the guess stood for eighty years. In May 2026, an OpenAI model found a counterexample. I checked the grid trick behind it in SQL Server, spatial queries included.

Read More
A rotating shoe carousel with shoes grouped by their different shapes

Counting Objects by Type in Every Database With One Query

July 6, 2021
Pinal Dave
SQL Tips and Tricks
Shrinking Database, Spatial Database, SQL Sample Database, System Database

One loop and one pivot give you tables, views, procedures and functions for every database. A planted demo database proves the counts.

Read More
A doorstop holding an unattended heavy door and preventing a rug from passing

Finding Long Open Transactions With sys.dm_tran_database_transactions

April 26, 2019
Pinal Dave
SQL Tips and Tricks
Shrinking Database, Spatial Database, SQL Transactions, System Database

A forgotten BEGIN TRAN can pin your log for hours. Here is how to find the owner, read its age, and confirm the transaction is the reason.

Read More
An ink brayer leaving a new continuous track while earlier linen stays clean

Recording Who Granted What With a Database Audit Specification

August 11, 2018
Pinal Dave
SQL Tips and Tricks
Shrinking Database, Spatial Database, SQL Sample Database, System Database

Current permissions never say who changed them. Set up a small audit, run a grant, a revoke and a failed attempt, and read the events back.

Read More
A canoe and its separate outrigger float with fitted support arms

Restoring a Database That Has a Memory-Optimized Filegroup

December 26, 2017
Pinal Dave
SQL Tips and Tricks
Shrinking Database, Spatial Database, SQL Sample Database, System Database

The container behind a memory-optimized filegroup is a folder, and a restore must place it. Here is the error you get when you forget, and the fix.

Read More
A hand rolls up a blue yoga mat; clay shapes sit on the rolled part while the flat section stays clean

Reverting a Failed Deployment With a Database Snapshot

June 17, 2017
Pinal Dave
SQL Tips and Tricks
Shrinking Database, Snapshot, Spatial Database, System Database

A snapshot can undo a bad release in minutes. See what comes back, what is lost for good, and why your log backups need a fresh start.

Read More
Matching bicycle bells with one lever deliberately adjusted

Database Scoped Configurations Changed From Their Defaults

December 6, 2016
Pinal Dave
SQL Tips and Tricks
Shrinking Database, Spatial Database, SQL Sample Database, System Database

One column in sys.database_scoped_configurations finds every setting that differs from its default. I show how to use it, and where it goes blind.

Read More
1 2 3 4 … 6 Next
  • Books
  • Testimonials
  • Privacy Policy

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