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 coconut scraper extracts white shreds from a shell into a ceramic bowl

Converting XML Documents to JSON With FOR JSON PATH

September 7, 2011
Pinal Dave
SQL Tips and Tricks
Database, SQL Scripts, SQL Server

A partner asks for JSON from your XML export. Build the nested shape, decide what an empty order looks like, and avoid the escaped-array surprise.

Read More
An unfinished clay cup sits beside a smooth finished cup on a potter's workbench.

What a Preview Build Is For, and What It Is Not

September 6, 2011
Pinal Dave
SQL Tips and Tricks
Best Practices, Database, SQL Scripts, SQL Server

Use a SQL Server preview to test specific features and report reproducible issues while keeping production data and recovery paths separate.

Read More
A citrus reamer and two orange halves beside a basket of untouched whole oranges

AT TIME ZONE Cost: Converting Many Rows Without Burning CPU

September 5, 2011
Pinal Dave
SQL Tips and Tricks
SQL Performance, SQL Scripts, SQL Server

Converting a whole column with AT TIME ZONE looks harmless on three rows and hurts on a hundred thousand. Here is the cheaper way to filter a local day.

Read More
A team tree with Maya at level 1, Arjun and Lena at level 2 and Noor at level 3, beside four rowpatterns and their rows: the one-level path returns Maya, the two-level path returns Arjun and Lena, the three-level path returns Noor, and a double slash path returns all four

OPENXML Rowpattern in SQL Server: Search Every Level and Read the Parent

September 4, 2011
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL Stored Procedure, SQL XML

An OPENXML rowpattern decides which XML elements become rows. This post tests absolute paths, a double slash that searches every level, and the ../ column pattern that reads the parent and grandparent. It repeats the result with nodes() and explains the flags value. Every result comes from SQL Server 2025.

Read More
A Trips table with four rows, one with a NULL number of days, beside the same data as XML where the Quito Trip element has no Days element

Shredding XML in SQL Server: Turn XML Back Into Rows

September 2, 2011
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL Table Operation, SQL XML

Shredding XML means turning XML back into rows and columns. This post writes a small table out with FOR XML PATH, reads it back with nodes() and value(), and proves the copy matches the original, NULL included. It also shows two easy mistakes: a path in the wrong case and a missing [1]. Every result comes from SQL Server 2025.

Read More
Rows of filled jam jars on a farmhouse table, one hand twisting on a lid, one jar at a time.

Scalar Functions and Performance

September 2, 2011
Pinal Dave
SQL Performance
Compatibility Level, Execution Plan, SQL Function, SQL Server, SQL Server 2019

Scalar functions can hide row-by-row work in SQL Server; learn when inlining helps, how to inspect eligibility, and when a set-based rewrite wins.

Read More
Several small plain brass locks beside one larger plain lock on a warm wooden tabletop.

What Lock Escalation Is and How to Stop It

September 1, 2011
Pinal Dave
SQL Performance
Best Practices, SQL Index, SQL Performance, SQL Server

Understand lock escalation, confirm it with evidence, and reduce its impact through smaller transactions, better access paths, and modern locking.

Read More
Previous 1 … 307 308 309 310 311 312 313 … 416 Next
  • Books
  • Testimonials
  • Privacy Policy

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