Where should I find [sp_xml_preparedocument]?

May 2024 ยท 1 minute read

I recently used [sp_xml_preparedocument] to parse an XML file to analyze the parameter data.

What is interesting to me is that when I drill into my SQLServer 2k8r2 instance I cannot seem to actually find a procedure named [sp_xml_preparedocument].

I've been looking in System Databases/Mater and the Db I created for the analysis and it does not appear.

However [EXEC sp_xml_preparedocument @hdoc OUTPUT, @x] executes just fine.

I'd like to deepen my understanding of what is occurring and review the actual procedure.

Where should this stored procedure actually appear?

1

1 Answer

sp_xml_preparedocument is a system extended stored procedure. From SSMS Object Explorer, you'll find it under Databases-->System Databases-->Programmability-->System Extended Stored Procedures.

Since it's an unmanaged extended proc written in C++, not T-SQL, so you won't be able to review the source code. It used to just wrap the msxml COM API but I'm not sure if that's still the case nowadays since it's internal SQL Server code.

2

ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJoa3BpYGeFeoOOsJ%2BeqpViwKm71KWbZqFdm7avsIysp2awnaF6sb7EqZirnZSksLa5xKer