Monday, March 12, 2012

Reusing XML from a table

I have a large well formed XML document which I recieved from a program. In
order to quickly insert it into the database, I set up a table with an
identity column and an ntext column. This works great for queuing the
documents, but I need to retrieve the ntext column and use
sp_xml_preparedocument on it so that I can shred the document and process th
e
hierarchal data. I have not found a way to dynamically use the column from m
y
table since you can not declare an ntext column as a local variable. Any
ideas?
--
Bob bAnd you won't. I understand your issue and you certainly aren't
the first to have this problem. You'll need to use ADO or ADO.NET
to at least retrieve it and pass it back to a stored procedure as an
input parameter. Or, parse the XmlDocument client side and send
the data back normally.
This is sort of on target:
http://www.eggheadcafe.com/articles...er_bulkload.asp
2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.learncsharp.net/home/listings.aspx
"bob b" <bobb@.discussions.microsoft.com> wrote in message
news:0194A7E4-952D-4D7D-9CF1-10A9ED508178@.microsoft.com...
>I have a large well formed XML document which I recieved from a program. In
> order to quickly insert it into the database, I set up a table with an
> identity column and an ntext column. This works great for queuing the
> documents, but I need to retrieve the ntext column and use
> sp_xml_preparedocument on it so that I can shred the document and process
> the
> hierarchal data. I have not found a way to dynamically use the column from
> my
> table since you can not declare an ntext column as a local variable. Any
> ideas?
> --
> Bob b|||Besides very ugly workarounds such as using nested EXEC or sp_OA stored
procs, you better use the SQLXML 3.0 XML Bulkload object client-side.
Note that SQL Server 2005 has fortunately no such limits anymore.
Best regards
Michael
"Robbe Morris [C# MVP]" <info@.turnkeytools.com> wrote in message
news:%23MfyA2fHFHA.3352@.TK2MSFTNGP10.phx.gbl...
> And you won't. I understand your issue and you certainly aren't
> the first to have this problem. You'll need to use ADO or ADO.NET
> to at least retrieve it and pass it back to a stored procedure as an
> input parameter. Or, parse the XmlDocument client side and send
> the data back normally.
> This is sort of on target:
> http://www.eggheadcafe.com/articles...er_bulkload.asp
> --
> 2005 Microsoft MVP C#
> Robbe Morris
> http://www.robbemorris.com
> http://www.learncsharp.net/home/listings.aspx
>
> "bob b" <bobb@.discussions.microsoft.com> wrote in message
> news:0194A7E4-952D-4D7D-9CF1-10A9ED508178@.microsoft.com...
>

No comments:

Post a Comment