SQL Server emergency? Email pinal@sqlauthority.com with URGENT in the subject line.

XML Data Type Methods in SQL Server: query, value, exist, modify and nodes

XML data type methods are the five functions you call on an xml column or variable: query(), value(), exist(), modify() and nodes(). Each gives back a different kind of answer: xml, a typed value, 1 or 0, a changed document or rows. This post runs all five on one small table of seeds, shows two common errors, and asks SQL Server what each method returns. Every result comes from SQL Server 2025.

Continue Reading

SQL Error Actions: What SQL Server Does After an Error

SQL error actions decide what runs after an error in SQL Server. This post shows statement termination, scope abortion, batch termination, connection termination and XACT_ABORT, with real results from three small stored procedures. It also covers what each reaction does to an open transaction and how TRY…CATCH changes the outcome.

Continue Reading

Query Hint Basics: Why a Variable Scans and OPTIMIZE FOR Seeks

Query hint basics start with one idea: a query hint is an instruction you add to one statement in the OPTION clause. This post builds a table of 50,010 tickets, shows a seek for a literal value, a scan for the same value in a variable, and a seek again with OPTIMIZE FOR and with RECOMPILE. It also shows what the hint costs when the value changes. Every number comes from SQL Server 2025.

Continue Reading