Re: sp_xml_preparedocument and Text datatypes



In addition to Graeme's answer.

In SQL Server 2000, you have only parameters of type TEXT/NTEXT, no
variables. So passing the data back into the business logic and back, or -
better - use OpenXML the first time the data gets into the server are the
only ways to process such data.

In SQL Server 2005, the limitations have been removed and you should have no
problem anymore....

Best regards
Michael

"Graeme Malcolm" <graemem_cm@xxxxxxxxxxx> wrote in message
news:eISGUmM%23FHA.3804@xxxxxxxxxxxxxxxxxxxxxxx
> Depending on the size of your XML document, you can also use varchar or
> nvarchar, which allows you to pass the data in via a parameter. In SQL
> Server 2005, you can use varchar(max) / nvarchar(max) or the new xml data
> type.
>
> --
> Cheers,
> Graeme
> _____________________
> Graeme Malcolm
> Principal Technologist
> Content Master
> - a member of CM Group
> www.contentmaster.com
> "W1ld0ne74" <W1ld0ne74@xxxxxxxxxxx> wrote in message
> news:22358286-752A-4A0A-9683-2D6ABD5D165E@xxxxxxxxxxxxxxxx
>> Okay: Provided below is a snipped from the SQL Books online: (Hope I
>> don't
>> get nailed for copy right)
>>
>> 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.
>>
>> The question I have is that the xmlText parameter in
>> sp_xml_preparedocument
>> can accept a Text data type. However, you can not create a local variable
>> of
>> type text and you can also not drop a select statement into that stored
>> proc... How are you supposed get a string of XML stored in a Text
>> dataType in
>> the database, into this procedure. The last thing I want to do is to
>> select
>> the text datatype out into my business logic just to pass it back in for
>> processing?
>>
>> Am I being stupid?
>>
>> I'm stumpped.
>>
>> Any help would be apreciated.
>
>


.



Relevant Pages

  • Re: Namespace Prefixes
    ... Does your "party" object to the use of a target namespace or just the ... You can work with XML documents without the target ... namespace and prefix by using custom XML pipelines so long as you don't have ... others want an xml document with no target namespace ...
    (microsoft.public.biztalk.general)
  • Re: xpath question
    ... xpath is used to return a nodeset directly from the xml document. ... match a default namespace may be arbitrary. ... namespace should also match because the prefix in the xpath exactly ...
    (comp.text.xml)
  • Re: Xpath query fails to return a node
    ... You can choose any prefix you like, you just need to use a prefix as those elements are in a namespace. ... The XML document uses a default namespace declaration (e.g. ... So with XPath 1.0 to select elements in a certain namespace you need to bind a prefix to the namespace URI and use that prefix to qualify element names. ...
    (microsoft.public.dotnet.xml)
  • Re: Using .NET XmlDocument Class, How to use a xpath expression on xml document which has a default
    ... You have a default namespace declared in your XML document. ... prefix the namespace ... names will work in your Xpath expressions. ...
    (microsoft.public.dotnet.xml)
  • Re: SQL Adapter
    ... Using namespaces in OPENXML is fraught with danger! ... Here is an example SQL that works with your Xml document ... My advice is to remove the namespace from the BodyRoot schema. ... If I leave the namespace declaration in there, ...
    (microsoft.public.biztalk.general)