Pro T-Sql 2012 Programmer's Guide by Michael Coles & Scott Shaw & Jay Natarajan & Rudi Bruchez

Pro T-Sql 2012 Programmer's Guide by Michael Coles & Scott Shaw & Jay Natarajan & Rudi Bruchez

Author:Michael Coles & Scott Shaw & Jay Natarajan & Rudi Bruchez [Coles, Michael & Shaw, Scott & Natarajan, Jay & Bruchez, Rudi]
Language: eng
Format: epub
Tags: Computers, Database Management, Programming Languages, General, Sql
ISBN: 9781430245964
Publisher: Apress
Published: 2012-09-26T04:00:00+00:00


The OPENXML rowset provider shreds the internal DOM representation of the XML document into relational format. The result of the rowset provider can be queried like a table or view, as shown following:

SELECT

Id,

ParentId,

NodeType,

LocalName,

Prefix,

NameSpaceUri,

DataType,

Prev,

[Text]

FROM OPENXML(@docHandle, N'/Customers/Customer');

The OPENXML rowset provider accepts up to three parameters:

The first parameter, hdoc, is the int document handle returned by the call to the sp_xml_preparedocument procedure.

The second parameter, known as rowpattern, is an nvarchar XPath query pattern that determines which nodes of the XML document are returned as rows.

The third parameter is an optional flags parameter. This tinyint value specifies the type of mapping to be used between the XML data and the relational rowset. If specified, flags can be a combination of the values listed in Table 11-1.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.