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 painting shows a closed loop of blue rope beside a straight rope ending at a brass boundary pin.

Recursive CTE Cycles: Detect Loops and Depth Boundaries

September 20, 2008
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL String

Recursive CTE cycles need evidence of the repeated relationship. Use a visited path and separate cycle flags from deliberate depth boundaries.

Read More
A long string of bunting laid out on a village green while two hands check the last knot

Generating Backup Commands for Every Database With STRING_AGG

August 17, 2008
Pinal Dave
SQL Tips and Tricks
DBA, SQL Backup and Restore, SQL Scripts, SQL String

Use STRING_AGG for generating backup commands with copy-only backups, checksums, safe database names, and dated files for careful review.

Read More
A hand cutting a sugarcane stalk at its natural joints on a chopping block, the cut sections lying in a row beside it.

Splitting a URL Into Host, Path and Query String in T-SQL

August 13, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL String

Practice splitting a URL into host, path, and query values with T-SQL string functions, SQL Server 2025 regex, and ordered parameter rows.

Read More
Slate-blue and sage ribbon loops around a wooden spindle, with a cream loop and vermilion end.

STRING_AGG Order: Keep NULLs and Type Width Visible

June 11, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Group By, SQL Server, SQL String

STRING_AGG order belongs inside WITHIN GROUP. This example preserves duplicate labels, shows how NULL differs from empty text and casts to nvarchar(max) before aggregation.

Read More
A clear tumbler and a corked glass bottle with a sage ribbon on warm paper.

STRING_ESCAPE JSON Text: Escaping Is Not Serialization

May 20, 2008
Pinal Dave
SQL Tips and Tricks
JSON, SQL Function, SQL Server, SQL String

STRING_ESCAPE JSON text is still text that belongs inside a JSON string. This example compares quotations, backslashes and a newline with complete FOR JSON PATH objects.

Read More
Gouache painting: a long tan leather strap lies straight across a workbench with two brass studs a short gap apart near its middle

CHARINDEX Start Position: Find the Second Delimiter

April 27, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL String

CHARINDEX start position finds the next delimiter. Guard a missing first match, preserve NULL, and extract empty fields without negative lengths.

Read More
A perforated brass insert in a rectangular wooden tray beside a vermilion wooden piece on a round tray and a sage bowl.

PATINDEX and CHARINDEX: Pattern or Literal Search

April 13, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL String

PATINDEX and CHARINDEX answer different questions. Compare wildcard patterns with literal searches, preserve NULL, and pin collation for digit ranges.

Read More
Previous 1 … 15 16 17 18 19 20 21 22 Next
  • Books
  • Testimonials
  • Privacy Policy

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