Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Load xml into the table

Author  Topic 

vgr.raju
Yak Posting Veteran

95 Posts

Posted - 2005-11-15 : 22:20:13
I have the xml document.
I want to parse and load the xml doc into the table.
Would some one let me know how to do that?
The following is my xml document.

<?xml version="1.0" ?>
<Errors>
<Write>
<set>
<Error ID1="13792" ID2="1-AO67PY" Message="Can't find a matching value in the picklist: MS Market Play SearchSpec: [Name : OE Productivity] [Sub Type : FY2005]" />
</set>
<set>
<Error ID1="15277" ID2="1-7W2JR9" Message="Can't find a matching value in the picklist: MS Market Play SearchSpec: [Name : XP Reloaded] [Sub Type : FY2005]" />
</set>
<set>
<Error ID1="15290" ID2="1-B9KNYU" Message="Can't find a matching value in the picklist: MS Market Play SearchSpec: [Name : Connected Systems] [Sub Type : FY2005]" />
</set>
<set>
<Error ID1="15291" ID2="1-82GVER" Message="Can't find a matching value in the picklist: MS Market Play SearchSpec: [Name : OE Productivity] [Sub Type : FY2005]" />
</set>
<set>
<Error ID1="15292" ID2="1-AWBIMZ" Message="Can't find a matching value in the picklist: MS Market Play SearchSpec: [Name : Realize Value] [Sub Type : FY2004]" />
</set>
<set>
<Error ID1="15293" ID2="2R-38UNMC" Message="Can't find a matching value in the picklist: MS Market Play SearchSpec: [Name : Realize Value] [Sub Type : FY2004]" />
</set>
<set>
<Error ID1="15294" ID2="2R-51WZI9" Message="Can't find a matching value in the picklist: MS Market Play SearchSpec: [Name : OE Productivity] [Sub Type : FY2005]" />
</set>
<set>
<Error ID1="15297" ID2="1-A8R39K" Message="Can't find a matching value in the picklist: MS Market Play SearchSpec: [Name : Connected Systems] [Sub Type : FY2005]" />
</set>
<set>
<Error ID1="15298" ID2="1-BKGF8K" Message="Can't find a matching value in the picklist: MS Market Play SearchSpec: [Name : OE Productivity] [Sub Type : FY2005]" />
</set>
<set>
<Error ID1="15301" ID2="1-95DZ8K" Message="Can't find a matching value in the picklist: MS Market Play SearchSpec: [Name : OE Productivity] [Sub Type : FY2005]" />
</set>
<set>
<Error ID1="15303" ID2="1-9KEYWK" Message="Can't find a matching value in the picklist: MS Market Play SearchSpec: [Name : XP Reloaded] [Sub Type : FY2005]" />
</set>
<set>
<Error ID1="15329" ID2="1-AVA6AG" Message="Can't find a matching value in the picklist: MS Market Play SearchSpec: [Name : Connected Systems] [Sub Type : FY2005]" />
</set>
<set>
<Error ID1="15330" ID2="2R-5LVXPN" Message="Can't find a matching value in the picklist: MS Market Play SearchSpec: [Name : Connected Productivity] [Sub Type : FY2005]" />
</set>
</Write>
</Errors>

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2005-11-15 : 22:30:33
I'd write a .NET console app to do that. .NET is great for both parsing XML and talking to SQL Server.



Damian
"A foolish consistency is the hobgoblin of little minds." - Emerson
Go to Top of Page

vgr.raju
Yak Posting Veteran

95 Posts

Posted - 2005-11-15 : 22:33:16
Hi Mervin,
Thanks for your reply.
I am really bad in .Net.
Would you post the code pls?
Thanks
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2005-11-15 : 23:38:07
Sorry, I don't have time to write the code for you. I have my own job to do.

and.... Mervin ???



Damian
"A foolish consistency is the hobgoblin of little minds." - Emerson
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2005-11-15 : 23:40:05
You might want to search google vgr. You will pull up about 2 million examples of how to do this.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page
   

- Advertisement -