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
Three porch hooks: a flowering basket, a basket of bare soil, and one empty hook with nothing on it.

JSON_PATH_EXISTS and Typed ISJSON in SQL Server 2022

April 18, 2012
Pinal Dave
SQL Tips and Tricks
JSON, SQL Constraint and Keys, SQL Function, SQL Server, SQL Server 2022

Validate payloads with JSON_PATH_EXISTS and typed ISJSON in SQL Server 2022, distinguish null from missing, and enforce a clear contract.

Read More
A very long striped knitted scarf trailing from an armchair across the floor, needles still in the last row

Storing Durations and Summing Time Past 24 Hours

April 12, 2012
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL DateTime, SQL Function, SQL Server

Use whole seconds for summing time beyond 24 hours, aggregate safely, format unlimited hours, and convert legacy time values.

Read More
Repeated bundles of loose bed slats sit beside the compact assembled bed frame

Triangular Joins: The Hidden Row Explosion in Self-Joins

April 6, 2012
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Group By, SQL Joins, Temp Table

A small grouped result can hide a huge pile of row pairs. Here is how to count them and what to do instead.

Read More
A ski boot remains attached to a ski by a closed heel binding beside the open toe release

Computed Column UDFs: Why Every Query on the Table Goes Serial

March 22, 2012
Pinal Dave
SQL Performance
Computed Column, Execution Plan, Parallel, SQL Function

A computed column that calls a scalar function can block parallel plans for queries that never read it. Here is how to spot it and test a fix.

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
An egg slicer lowers parallel wires through one egg beside individually cut egg slices

Replacing a Running Total Cursor With a Window Function

March 16, 2012
Pinal Dave
SQL Tips and Tricks
SQL Cursor, SQL Function, SQL Order By, Temp Table

That loop adding to a variable can usually become one window function. Here is the proof that the balances match, and the tie trap to watch for.

Read More
Gouache painting of a frog leaping across four lily pads on a pond, the last pad holding a red flower

Detect a Leap Year in T-SQL: Four Simple Ways

February 28, 2012
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

Detecting a Leap Year in T-SQL takes one rule or one date trick. This post tests four ways on SQL Server 2025: the calendar rule, EOMONTH, TRY_CONVERT and DATEDIFF. It shows that all four agree on 209 years, explains the century years that trip people up, and answers how leap years affect date math.

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

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