Dear All,
I am using
sp_xml_preparedocument hdoc OUTPUT
[, xmltext]
[, xpath_namespaces]
How do I pas a file or a long string into xmltext ?
(The file is more than about 300 Kbytes in size).
Using the a quoted text of the file at xmltext works.
So how do I get the file there, or a database field there ?
Ben Brugman"ben brugman" wrote:
> Dear All,
> I am using
> sp_xml_preparedocument hdoc OUTPUT
> [, xmltext]
> [, xpath_namespaces]
> How do I pas a file or a long string into xmltext ?
> (The file is more than about 300 Kbytes in size).
> Using the a quoted text of the file at xmltext works.
> So how do I get the file there, or a database field there ?
> Ben Brugman
>
Hi Ben
You don't say which version of SQL Server this is!
http://sqlxml.org/faqs.aspx?faq=61 suggests declaring a parameter and using
it as a variable. You can (possiblty) use BCP/BULK INSERT or OPENXML in
SQL2000 to load the data in. In SQL 2005 you can also use OPENROWSET to load
in the file. Examples are in Books Online.
John|||"John Bell" <jbellnewsposts@.hotmail.com> schreef in bericht
news:78EC2FA5-DE22-4DBF-A762-0B40B15E14EA@.microsoft.com...
> "ben brugman" wrote:
>> Dear All,
>> I am using
>> sp_xml_preparedocument hdoc OUTPUT
>> [, xmltext]
>> [, xpath_namespaces]
>> How do I pas a file or a long string into xmltext ?
>> (The file is more than about 300 Kbytes in size).
>> Using the a quoted text of the file at xmltext works.
>> So how do I get the file there, or a database field there ?
>> Ben Brugman
>>
> Hi Ben
> You don't say which version of SQL Server this is!
> http://sqlxml.org/faqs.aspx?faq=61 suggests declaring a parameter and
> using
> it as a variable. You can (possiblty) use BCP/BULK INSERT or OPENXML in
> SQL2000 to load the data in. In SQL 2005 you can also use OPENROWSET to
> load
> in the file. Examples are in Books Online.
I am using SQLServer 2000. The problem at the moment is that the file has
300Kbytes,
and a variable can only hold 8000, so this won't fit. And although
sp_xml_preparedocument can handle the text type, there is no variabele for
this. Using a stored procedure with a text parameter there is no way to fill
the parameter with the 300K bytes text, from a file or a table field.
That is if I get the file in a text field in the first place, haven't even
thought about that problem.
I followed your link to faq=61, (also
http://www.sqlxml.org/faqs.aspx?faq=42)and read some other questions as
well, and allthough I have seen the 'correct' questions, most of the
questions do not even get answered (or I am missing something). Even an
anwser that say it's not possible what I want is ok, but at the moment I am
thinking the only soluttion is complex very unelegant and risky and involves
a lot of coding.
I am supprised that MicroSoft supplies this functionality but then cripples
it to XML length's of only 8000 bytes. (Look like crippleware, or a demo
version, were you can taste the product, but have to buy it to enjoy the
product, except in this case it's the complete product).
Any suggestions are welcome.
Thanks for your time and attention,
Ben Brugman