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
 SQL Server Administration (2000)
 Data from XML file to table

Author  Topic 

ricky_newbee
Posting Yak Master

126 Posts

Posted - 2004-11-23 : 09:26:15
All,
I was looking for some ideas on how to get data from xml file to Sql Server tables. i have a Scenario here. we have main frame legacy system, developers get data from main frame in xml format. right now they are using VB and PERL to load xml data into SQL server tables. We have scheduled jobs for this process. These jobs take hell of a time any way. I was looking for some process which can get data from xml file to SQL server tables.

Thanks,
Rick

nr
SQLTeam MVY

12543 Posts

Posted - 2004-11-23 : 09:42:09
Have a look at xmlbulkinsert.
Depending on the xml format you could also maybe bcp into a staging table and parse it in t-sql - that's what I try to do for simplicity but for complex xml formats it's not a good idea.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-11-23 : 09:46:04
One of the SQLXML releases introduced an XML Bulk Load capability. You should do a search on Microsoft's web site for "XML bulk load", but this should get you started:

http://support.microsoft.com/default.aspx?scid=kb;en-us;316005
Go to Top of Page

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2004-11-23 : 09:46:52
I second the XML Bulk Load tool -- There are many articles on using this tool. Here is one:

http://support.microsoft.com/default.aspx?scid=kb;en-us;316005&Product=sql2k


I guess I third the recommendation
Go to Top of Page

ricky_newbee
Posting Yak Master

126 Posts

Posted - 2004-11-23 : 09:55:34
Thank you guys. That's a good start for me. I went through the microsoft site and again it has to be VB which uses the XML Bulk Load component to load data. But, i appriciate your help.
Go to Top of Page
   

- Advertisement -