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
SQL SERVER - Beginning SQL 2012 - Spatial Unions and Collections

SQL SERVER – Beginning SQL 2012 – Spatial Unions and Collections

February 27, 2013
Pinal Dave
SQL Tips and Tricks
Joes 2 Pros, Spatial Database, SQL Scripts, SQL Server

Aggregates are not just for sales totals. Much like a jigsaw puzzle, spatial unions assemble land coordinates together. Learn spatial unions and collections in SQL 2012.

Read More
SQL Server Spatial object invalid due to overlapping edges.

SQL SERVER – Validating Spatial Object as NULL using IsNULL

June 30, 2012
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function

How do spatial functions handle NULL? I show two ways of validating a spatial object as NULL: the IsNULL method, which returns 0 or NULL, and IsValidDetailed.

Read More
SQL SERVER - Validating Spatial Object with IsValidDetailed Function

SQL SERVER – Validating Spatial Object with IsValidDetailed Function

June 29, 2012
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Scripts

Invalid spatial objects used to give only a simple error. The IsValidDetailed function tells you whether a shape is valid and, when it is not, the reason why.

Read More
A graph plotting data points on a coordinate grid.

SQL SERVER – Finding Shortest Distance between Two Shapes using Spatial Data Classes – Ramsetu or Adam’s Bridge

March 18, 2012
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function

Using ShortestLineTo in SQL Server spatial data classes, I find the shortest distance between two shapes, with a fun Ramsetu, or Adam’s Bridge, example.

Read More
A drawing compass on cream paper, its pencil arc just touching the nearest of several scattered pebbles.

Finding the Nearest Location With a Spatial Index

September 19, 2010
Pinal Dave
SQL Performance
Execution Plan, Spatial Database, SQL Index, SQL Server

A nearest location query in SQL Server needs TOP, STDistance in WHERE and ORDER BY, matching SRIDs, and a checked spatial plan.

Read More
An archaeological dig divided by strings into square cells, a trowel working in one small cell with a red shard.

Spatial Indexes: Speeding Up Distance Searches

August 24, 2010
Pinal Dave
SQL Performance
Execution Plan, Spatial Database, SQL Index, SQL Server

Use spatial indexes for geography distance searches, compare actual plans and reads, and inspect tessellation with built-in diagnostics.

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

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