loaidng xml file into table
Hi Team,
I want to load the following xml file. please give some suggestion on this
<?xml version="1.0" ?>
- <enrolment date="2011-02-10T21:45:00.3811504Z" xmlns:fx="http://schemas.flexfinancialsolutions.com/enrolment">
<account>7862</account>
- <tpa>
<name>ACEG Services</name>
<affinity>The Insurance Services</affinity>
</tpa>
- <product>
<name>G6103 A&D</name>
- <plan>
<name>Default Plan</name>
<policynumber>G6103</policynumber>
</plan>
</product>
- <field>
<name>productURL</name>
<value>http://www.google.com</value>
</field>
- <field>
<name>First Name</name>
<value>Peter</value>
</field>
- <field>
<name>Middle Initial</name>
<value>P</value>
</field>
- <field>
<name>Last Name</name>
<value>Smith</value>
</field>
- <field>
<name>Member ID</name>
<value>55555</value>
</field>
- <field>
<name>Address</name>
<value>555 any street</value>
</field>
- <field>
<name>City</name>
<value>any city</value>
</field>
- <field>
<name>State</name>
<value>NJ</value>
</field>
- <field>
<name>Zip</name>
<value>01888</value>
</field>
</enrolment>
Thanks,
Eshwar
February 11th, 2011 4:20am
USE tempdb
CREATE TABLE T (IntCol int, XmlCol xml)
GO
INSERT INTO T(XmlCol)
SELECT * FROM OPENROWSET(
BULK 'c:\temp\test.xml',
SINGLE_BLOB) AS x
GO
SELECT * FROM T
GO
I think it will work....!
---------------------------------------------------------------------
If this post is useful and can able to solve your problem then please mark this post as answered..
Free Windows Admin Tool Kit Click here and download it now
February 11th, 2011 4:24am
sorry forgot to mention my database is 2000.
Regards,
Eshwar
February 11th, 2011 4:31am
Try this it will work..
Free Windows Admin Tool Kit Click here and download it now
February 11th, 2011 4:33am
got an error it cannot find the data type xml
Regards,
Eshwar
February 11th, 2011 4:35am