473,379 Members | 1,222 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,379 software developers and data experts.

Loading data from xml http stream

Hi,

I have a problem which I don't entirely know how to tackle:

Essentially, is it possible to query a web service (via http), using
sql server 2000, and then import that data in to the database?

I have seen many posts on openxml and sql servers bulk load facilities
but nobody seems to mention whether you can open an http stream and
read the xml in from there.

Any help would be greatly appreciated.

Thanks.

May 8 '07 #1
3 2441
I had recently implement similar solution in SQL Server 2000. Here is a
simplified outline of the process:

- Write a small helper application (any language that has Internet
capabilities will do: C#, VB.NET, etc.) to connect to the Web service URL
and download the XML to a stream. In my case I had the application take all
parameters from tables in the DB (like download schedule, URL, etc.).
- Create a stored procedure that takes a parameter of data type NTEXT. Then
inside the SP use sp_xml_preparedocument and OPENXML to parse and store the
XML document into a table.
- Call the SP from your helper application passing the stream as an input
parameter. Then there are multiple ways to schedule your helper application
to run at regular intervals (in my case it was set up as service).

There are a lot of data validation, encryption, etc. steps that I am
skipping in this outline.

HTH,

Plamen Ratchev
http://www.SQLStudio.com
May 8 '07 #2
Further to the process Plamen outlined , for step 1 , I used a HTTP file
downloader i.e Lynx, which allowed me to add a list of XML files.

If you are using SQL 2000 and OPENXML , you will have problems. If this is
the case , check http://www.quicksqlserver.com/2007/0...l_more_th.html

--

Jack Vamvas
___________________________________
Need an IT job? http://www.ITjobfeed.com/sql

<a href="http://www.itjobfeed.com/sql"sql it jobs</a>

<ma******@googlemail.comwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
Hi,

I have a problem which I don't entirely know how to tackle:

Essentially, is it possible to query a web service (via http), using
sql server 2000, and then import that data in to the database?

I have seen many posts on openxml and sql servers bulk load facilities
but nobody seems to mention whether you can open an http stream and
read the xml in from there.

Any help would be greatly appreciated.

Thanks.

May 10 '07 #3
"Jack Vamvas" <DE**********@del.comwrote in message
news:_s******************************@bt.com...
>
If you are using SQL 2000 and OPENXML , you will have problems. If this is
the case , check
http://www.quicksqlserver.com/2007/0...l_more_th.html
This is why I had to pass the XML content to the SP as NTEXT. That removes
the limitation of 8000 characters if trying to read the XML file directly
from SQL Server 2000. But the method in the link that you provided works
too, if direct read from a file is needed.

Plamen Ratchev
http://www.SQLStudio.com
May 10 '07 #4

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

Similar topics

5
by: Kurt Bauer | last post by:
I have an ASP group calendar application which pulls calendar data from Exchange via webdav into an XML string. I then loop the XML nodes to populate a collection of appointments. Finally I use...
5
by: Morten Nielsen | last post by:
I'm trying to load an XML file, that references a DTD without a relative URL. This renders the error: Could not find file "C:\WINNT\system32\capabilities_1_1_0.dtd". Here's the XML I'm loading:...
3
by: Jonathan Buckland | last post by:
Can someone give me an example how to append data without having to load the complete XML file. Is this possible? Jonathan
11
by: Detlef Hüttenbach | last post by:
Whereas loading tiffs and pngs from file into an Image WebControl work, the images aren't shown when loaded from streams: In a WebForm, the image's property "ImageUrl" is set to a handler, and...
1
by: campwes | last post by:
Hey, all! We're having trouble displaying SQL Server data in a web site as XML, using a transform. The query is a simple SELECT statement. When running the query, we get the following error from...
5
by: Naamat | last post by:
Hello, I am the sample FPSEPublish (http://blog.baeke.info/blog/_archives/2005/3/3/393158.html) code to upload a document to Sharepoint (WSS). This works perfectly for samll documents. ...
5
by: Chuck Anderson | last post by:
I run Apache 2.0.55, and Php (both 4.4.1 and 5.2.5) on my home PC (Windows XP). One of the scripts that I run daily needs to access a secure URL (https://..............). When I am running Php4,...
2
by: =?Utf-8?B?UmljaA==?= | last post by:
On my development machine where I have Visual Studio 2005 loaded, I have an app that uses the Report control. I can view data in report format with the Report control -- the data renders OK in the...
5
by: DR | last post by:
Why is its substantialy slower to load 50GB of gzipped file (20GB gzipped file) then loading 50GB unzipped data? im using System.IO.Compression.GZipStream and its not maxing out the cpu while...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.