There are 2 main methods to work with XML Data in SQL.
- Requires error handling to ensure paired usage of sp_xml_preparedocument and sp_xml_removedocument
- Limits maximum memory usage for XML parsing of an instance to 1/8th of allocated SQL memory
- Performs better in many cases than “Nodes” method on low end CPUs
- Pattern to be used:
SET NOCOUNT ON
DECLARE @ErrorMessage NVARCHAR(4000)
DECLARE @ErrorSeverity INT