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
Gouache painting: five round buns sit in a row on a long bakery board

SUBSTRING Boundaries: Start at Zero, One or Beyond

October 8, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL String

SUBSTRING boundaries distinguish start zero, start one and positions past the end. Read empty strings, shortened counts and typed NULL results.

Read More
A rounded terracotta pot in a long shallow blue-gray ceramic tray.

STR: Check Width and Reduced Decimal Places

October 5, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL String

STR can reduce decimal places when its requested width cannot hold the complete fractional display. I inspect the complete text, including spaces and signs. A populated result does not guarantee that the number remains visible.

Read More
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
Previous 1 … 16 17 18 19 20 21 22 23 Next
  • Books
  • Testimonials
  • Privacy Policy

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