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 wooden xylophone with bars stepping from long to short, a red mallet resting between two neighbouring bars.

LAG and LEAD: Comparing Each Row With the One Before It

April 2, 2014
Pinal Dave
SQL Tips and Tricks
Ranking Functions, SQL Function, SQL Order By, SQL Server

Use LAG and LEAD for monthly comparisons, handle defaults and percent change, choose explicit frames, and detect status transitions.

Read More
An open bento box with neat compartments, one holding a row of small rice balls, a red plum on the rice.

JSON_OBJECT and JSON_ARRAY: Building JSON in SQL Server 2022

March 30, 2014
Pinal Dave
SQL Tips and Tricks
JSON, SQL Function, SQL NULL, SQL Server, SQL Server 2022

Build JSON_OBJECT and JSON_ARRAY values in SQL Server 2022, control null handling, nest arrays, and compare rowset and aggregate output.

Read More
A split pomegranate on a garden table, a hand lifting out one chamber full of red seeds

Querying Nested JSON Arrays With OPENJSON

February 19, 2014
Pinal Dave
SQL Tips and Tricks
JSON, SQL Function, SQL Scripts, SQL Server

Query nested JSON arrays with OPENJSON, preserve element positions, pass inner arrays with AS JSON, and handle missing or strict paths.

Read More
Matching brass iris rings have wide and narrow openings with different light patches behind them

Case-Insensitive and Multiline Regex Flags in SQL Server 2025

January 24, 2014
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL String, Testing

Your pattern passed the test string and then missed rows in the table. The flags and the line endings are the usual reason.

Read More
SQL SERVER - MySQL - PostgreSQL - How to Concat Strings?

SQL SERVER – MySQL – PostgreSQL – How to Concat Strings?

December 29, 2013
Pinal Dave
SQL Tips and Tricks
MySQL, PostgreSQL, SQL Function, SQL Scripts, SQL Server

How to concat strings the same way in SQL Server, MySQL and PostgreSQL? I switched from the plus operator to the CONCAT function, and here is why.

Read More
A person lifting a red blanket over a campfire, sending puffs of smoke across a valley at dusk

BASE64_ENCODE and BASE64_DECODE in SQL Server 2025

December 16, 2013
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Server, SQL String

Use BASE64_ENCODE in SQL Server 2025, decode binary and text safely, compare URL-safe output, and replace older XML encoding expressions.

Read More
SQL Server query window.

SQL SERVER – Building Three-Part Name from OBJECT-ID – Database Name, Schema Name, TableName

November 28, 2013
Pinal Dave
SQL Tips and Tricks
SQL Function

Have only an object_id? Here is a script to build the three-part name, database, schema and table, using DB_NAME, OBJECT_SCHEMA_NAME and QUOTENAME.

Read More
Previous 1 … 26 27 28 29 30 31 32 … 92 Next
  • Books
  • Testimonials
  • Privacy Policy

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