473,396 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Insert data from XML file to SQL Database

Hi,

Could anyone please give me a code example of how to insert data from
an XML file into a SQL database. So far I've got the data sitting in a
dataset...

Thanks
Aug 8 '08 #1
3 1473

Sql Server 2000 , OPENXML. Send the xml in as text (one way).
ds.GetXml() will work.

Sql Server 2005? SP2 introduced an slowness bug.
http://connect.microsoft.com/SQLServ...dbackID=250407

You'll have to consider sending in your ds.GetXml ..but convert it to
attribute based first.
Helper articles:
http://sholliday.spaces.live.com/blog/cns!A68482B9628A842A!148.entry
http://www.sqlservercentral.com/arti...rproblem/2283/
http://www.ipass.net/sloan/code/OPEN...yntax_Test.txt

Good luck.


"Dray" <al**@boxtop.co.ukwrote in message
news:7f**********************************@x35g2000 hsb.googlegroups.com...
Hi,

Could anyone please give me a code example of how to insert data from
an XML file into a SQL database. So far I've got the data sitting in a
dataset...

Thanks

Aug 8 '08 #2
On 8 Aug, 16:45, "sloan" <sl...@ipass.netwrote:
Sql Server 2000 , OPENXML. *Send the xml in as text (one way).
ds.GetXml() will work.

Sql Server 2005? *SP2 introduced an slowness bug.http://connect.microsoft.com/SQLServ...dback.aspx?Fee...

You'll have to consider sending in your ds.GetXml ..but convert it to
attribute based first.

Helper articles:http://sholliday.spaces.live.com/blog/cns!A68482B9628A842A!148.entryhttp://www.sqlservercentral.com/articles/Stored+Procedures/thezeroton...http://www.ipass.net/sloan/code/OPEN...yntax_Test.txt

Good luck.

"Dray" <a...@boxtop.co.ukwrote in message

news:7f**********************************@x35g2000 hsb.googlegroups.com...
Hi,
Could anyone please give me a code example of how to insert data from
an XML file into a SQL database. So far I've got the data sitting in a
dataset...
Thanks- Hide quoted text -

- Show quoted text -
Hi, thanks for your help. I was however thinking of using sqldataapter
update to do this but are not sure how to go about it...
Aug 8 '08 #3

I think you're barking up the wrong tree, but that's me.

SqlDataAdapters have a very "row by row"-ness to them.

If you want the "set based" or "bulk-ness" of xml, I think you'll have to do
some coding.

Here is one last helper article:
http://support.microsoft.com/kb/315968

........


"Dray" <al**@boxtop.co.ukwrote in message
news:65**********************************@j22g2000 hsf.googlegroups.com...
On 8 Aug, 16:45, "sloan" <sl...@ipass.netwrote:
Sql Server 2000 , OPENXML. Send the xml in as text (one way).
ds.GetXml() will work.

Sql Server 2005? SP2 introduced an slowness
bug.http://connect.microsoft.com/SQLServ...dback.aspx?Fee...

You'll have to consider sending in your ds.GetXml ..but convert it to
attribute based first.

Helper
articles:http://sholliday.spaces.live.com/blog/cns!A68482B9628A842A!148.entryhttp://www.sqlservercentral.com/articles/Stored+Procedures/thezeroton...http://www.ipass.net/sloan/code/OPEN...yntax_Test.txt

Good luck.

"Dray" <a...@boxtop.co.ukwrote in message

news:7f**********************************@x35g2000 hsb.googlegroups.com...
Hi,
Could anyone please give me a code example of how to insert data from
an XML file into a SQL database. So far I've got the data sitting in a
dataset...
Thanks- Hide quoted text -

- Show quoted text -
Hi, thanks for your help. I was however thinking of using sqldataapter
update to do this but are not sure how to go about it...
Aug 8 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Jack | last post by:
I have a text file of data in a file (add2db.txt) where the entries are already entered on separate lines in the following form: INSERT INTO `reviews` VALUES("", "Tony's", "Lunch", "Great...
7
by: Luis | last post by:
Application X has three screens. The user captures information on screen one and then clicks a navigation button to go onto screen two. He does the same on screen three. At the bottom of screen...
20
by: akej via SQLMonster.com | last post by:
Hi, i have table with 15 columns CREATE TABLE . ( PRIMARY KEY , NULL , NULL , NULL , NULL , (50) NULL , NULL
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
7
by: kosta | last post by:
hello! one of my forms communicates with a database, and is supposed to add a row to a table using an Insert statement... however, I get a 'oledb - syntax error' exception... I have double...
7
by: David Bear | last post by:
I have a dictionary that contains a row of data intended for a data base. The dictionary keys are the field names. The values are the values to be inserted. I am looking for a good pythonic...
46
by: dunleav1 | last post by:
I have a process that does inserts that runs 50% slower that Oracle and Mssql. Queries normally take 50% slower than normal. DB2, Oracle, Mssql all are configured on same os, same disk array...
8
by: andrewtayloruk | last post by:
Hi i was wondering if anyone could help.... I have made a little script that puts whatever a user enters into a mysql database. As well as the forms my script has an image input that uploads an image...
6
by: TheRealDan | last post by:
Hi all. I'm having a problem with a special characters. I have php script that reads from an xml file and writes to a mysql db. It's a script called phptunest that I found on the net, although the...
0
by: akshalika | last post by:
I am new to Biztalk. In my project we need to connect oracle database and insert data into oracle table using BizTalk project. I use WCF Adapter pack(SP2). I create biztalk project then using Consume...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.