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.
SQL Server emergency? Email pinal@sqlauthority.com with URGENT in the subject line.
OPENXML Rowpattern in SQL Server: Search Every Level and Read the Parent
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.
SQL Server slow? Let's fix it together in about four hours.
In my Comprehensive Database Performance Health Check, you share your screen, I guide you, and we fix your biggest performance troublemakers. No passwords. No remote access.
You keep every script, and the know-how to fix it yourself next time.
Want your whole team to learn it?
My Practical Workshop has no PowerPoint, just live demos. My AI Enablement Workshop shows your team where AI saves hours, and where it quietly costs them.
Over 400 customers have worked with me this way, and not one shared a password. See all consulting options.
Who We Are
Pinal Dave is an SQL Server Performance Tuning Expert and independent consultant with over 24 years of hands-on experience. He holds a Masters of Science degree and numerous database certifications.
Pinal has authored 19 books and 125 Pluralsight courses. To freely share his knowledge and help others build their expertise, Pinal has also written more than 5,800 database tech articles on his blog at https://blog.sqlauthority.com.
Pinal is also a CrossFit Level 1 Trainer (CF-L1) and CrossFit Level 2 Trainer (CF-L2).
Nupur Dave is a social media enthusiast and an independent consultant. She primarily focuses on the database domain, helping clients build short and long-term multi-channel campaigns to drive leads for their sales pipeline.
Shaivi Pinalkumar Dave is a book author and a women’s artistic gymnast.

