Re: sp_xml_preparedocument and Text datatypes
- From: "Michael Rys [MSFT]" <mrys@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 14 Dec 2005 15:59:52 -0800
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.
>
>
.
- References:
- Re: sp_xml_preparedocument and Text datatypes
- From: Graeme Malcolm
- Re: sp_xml_preparedocument and Text datatypes
- Prev by Date: Re: problem or bug in sqlxml 3.0
- Next by Date: Re: FOR XML AUTO, ELEMENTS
- Previous by thread: Re: sp_xml_preparedocument and Text datatypes
- Next by thread: sequence in FOR XML EXPLICIT
- Index(es):
Relevant Pages
|