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.
sp_xml_preparedocument: Prepare XML in Memory and Always Release It
sp_xml_preparedocument parses an XML document into memory and returns a handle that OPENXML can read. This post shows the safe pattern with TRY and CATCH, why the handle number is not yours to choose, what happens when you reuse a released handle, and how the WITH clause and flags shape the rows. Every result comes from SQL Server 2025.
Shredding XML in SQL Server: Turn XML Back Into Rows
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.
Scalar Functions and Performance
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.
What Lock Escalation Is and How to Stop It
Understand lock escalation, confirm it with evidence, and reduce its impact through smaller transactions, better access paths, and modern locking.
XML Element Names in SQL Server: Row, Root and Text With FOR XML PATH
XML element names in SQL Server come from your query, and FOR XML PATH lets you choose them. This post sets the row and root names, turns a column into an attribute, writes text inside an element and shows the error you get when an attribute column comes too late. Every result comes from SQL Server 2025.
FOR XML AUTO in SQL Server: Nest Joined Rows and Name the Root
FOR XML AUTO turns a join into nested XML, with one element per table. This post shows where the element names come from, why row order decides the grouping, how ROOT adds a single root, and how the order of your columns flips the nesting. Every result comes from SQL Server 2025.







