Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 16th, 2007, 09:30 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Albany, NY, USA.
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default Import XML to SQL table

It's a simple idea, but I can't find anything straightforward that I can do. I'd like to do this without using a 3rd party product.

Using the DTS Import functions don't seem to be the answer.

Has anyone imported an xml doc to a SQL table successfully?

Thanks in advance for your comments
  #2 (permalink)  
Old March 16th, 2007, 04:29 PM
Friend of Wrox
 
Join Date: Aug 2004
Location: Orange County, CA, USA.
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think that sql 2005 may have xml functionality might look there but I am not sure. If not many external languages(non sql/rdbms) have XML parsing abilities like Java, Flash action script, etc. You may just need to use one of those languages to parse the data then you can insert it into the database.

  #3 (permalink)  
Old March 19th, 2007, 01:31 PM
Friend of Wrox
 
Join Date: Oct 2003
Location: Albany, NY, USA.
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, I should have mentioned that I'm using SQL 2000.

I'm hoping to avoid writing a script, because this particular file has a complicated structure to it.
  #4 (permalink)  
Old March 21st, 2007, 10:46 AM
Friend of Wrox
Points: 1,243, Level: 13
Points: 1,243, Level: 13 Points: 1,243, Level: 13 Points: 1,243, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2003
Location: , , United Kingdom.
Posts: 290
Thanks: 24
Thanked 0 Times in 0 Posts
Default

Hi,

I have done it in the past using OPENXML in sql 2000. Or maybe just do an insert using a text field type in sql 2000.

CPall
  #5 (permalink)  
Old March 23rd, 2007, 08:37 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Albany, NY, USA.
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried to work a solution by using the ReadXML method of a dataset; that didn't work out. I eventually punted and tried doing a simple import into Excel and it worked perfectly. I was then able to quickly use DTS to import the spreadsheet. Fortunately, the recordset was only about 17,000 rows so I didn't have to worry about overflow with the spreadsheet (65,536 rows max).


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import a XML file into SQL Server tables Cha BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 0 April 1st, 2008 09:54 PM
How to import XML into SQL Server dbellavi XML 1 February 26th, 2008 06:02 AM
Import a Comma separated txt file to SQL table arielote C# 2 April 17th, 2006 01:08 AM
Import XML and its attribute into SQL server 2000 khautinh C# 0 April 13th, 2005 09:57 AM
How to import xml into SQL database thru ASP porsrari Classic ASP XML 4 October 14th, 2003 11:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.