Purposes of OPENXML clause sql server stored procedure - Sql server

Explain the purposes of OPENXML clause sql server stored procedure

OPENXML parses the XML data in SQL Server in an efficient manner. It’s primary ability is to insert XML data to the RDB. It is also possible to query the data by using OpenXML. The path of the XML element needs to be specified by using ‘xpath’.

The following is a procedure for retrieving xml data:
DECLARE @index int
DECLARE @xmlString varchar(8000)
SET @xmlString ='

Prasanth
9343463943/PhoneNo>


Laasya
9342673212

'

EXEC sp_xml_preparedocument @index OUTPUT, @xmlString

SELECT * FROM OPENXML (@index, 'Persons/Person') WITH (id varchar(10), Name varchar(100) 'Name' , PhoneNo varchar(50) 'PhoneNo')

EXEC sp_xml_removedocument @index
The above code snippet results the following:
15201 Prasanth 9343463943
15202 Laasya 9342673212
What is the order in which the SQL query is executed? - Sql server
The following is the order of executing SQL query: The query goes to the shared pool that has information like parse tree and execution plan for the corresponding statement.......
How to store pdf file in sql server?
Store pdf file in sql server - Create a column as type ‘blob’ in a table. Read the content of the file and save in ‘blob’ type column in a table.......
Concepts and capabilities of SQL Server
Concepts and capabilities of SQL Server - Microsoft SQL server is a relational database management system. It uses MS- SQL as the query language.......
Post your comment