Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Reduce Database RoundTrips Using XML Expand / Collapse
Author
Message
Posted Wednesday, November 3, 2004 4:42 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, December 7, 2010 6:58 AM
Points: 115, Visits: 17
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/


Post #144630
Posted Monday, November 29, 2004 3:16 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, May 20, 2005 10:05 AM
Points: 1, Visits: 1

Grate article. I find it very helpful

Thanks

Post #148459
Posted Tuesday, November 29, 2005 6:55 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, June 24, 2011 7:33 AM
Points: 157, Visits: 104

I use this a lot and it is a huge performance booster. Is there any reason that you shouldn't use the text or ntext data type as input to the stored procedure to avoide the 4000 byte limit? That would allow you 2,147,483,647 and 1,073,741,823 bytes respectively. I can't see passing that much data being practical, but you can blow out 4000 bytes quickly in an xml document. m I missing something here?

Syntax

sp_xml_preparedocument hdoc OUTPUT
[, xmltext]
[, xpath_namespaces]

Arguments

hdoc

Is the handle to the newly created document. hdoc is an integer.

[xmltext]

Is the original XML document. The MSXML parser parses this XML document.  xmltext is a text (char, nchar, varchar, nvarchar, text, or ntext) parameter. The default value is NULL, in which case an internal representation of an empty XML document is created.

[xpath_namespaces]

Specifies the namespace declarations that are used in row and column XPath expressions in OPENXML. The default value is <root xmlns:mp="urn:schemas-microsoft-com:xml-metaprop">.
xpath_namespaces provides the namespace URIs for the prefixes used in the XPath expressions in OPENXML by means of a well-formed XML document. xpath_namespaces declares the prefix that must be used to refer to the namespace urn:schemas-microsoft-com:xml-metaprop, which provides meta data about the parsed XML elements. Although you can redefine the namespace prefix for the metaproperty namespace using this technique, this namespace is not lost. The prefix mp is still valid for urn:schemas-microsoft-com:xml-metaprop even if xpath_namespaces contains no such declaration. xpath_namespaces is a text (char, nchar, varchar, nvarchar, text, or ntext) parameter.

Post #240584
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse