I want to pass XML and the data in the XML should be stored in the
tables of the database. However, I do not want to use the OpenXML
statement. Please let me know.
Regards, ShilpaShilpa (shilpa.nagavara@.unisys.com) writes:
> I want to pass XML and the data in the XML should be stored in the
> tables of the database. However, I do not want to use the OpenXML
> statement. Please let me know.
Which version of SQL Server are you using? If you are on SQL 2000, and
you to insert data in the XML statement piece by piece (and not just
the XML document as such), there is no alternative to OpenXML.
On SQL 2005 you can XQuery to extract data from the XML document.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Actually, there is an alternative for SQL Server 2000 to the OpenXML
statements: SQLXML BulkLoad. It's a COM-based application dll that you
can use to shove XML documents into relational tables. We just started
working with it, and though it's a bit trivky to set up, it actually
performs better with large amounts of XML than the OpenXML procedures.
However, I'm not sure I understand the OP's original question; OpenXML
is used for parsing XML documents into relational tables. If you just
want to store complete XML documents, just store them in a varchar or
text column. Unless you're specifically querying for a value embedded
in the XML document, it's just easier to manage.
HTH,
Stu
No comments:
Post a Comment