blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

SSIS Junkie

SSIS Nugget: Import data from a website

An interesting problem has been posed on the SSIS forum at SQL Server Central. The user wants to download a file containing stock information from Yahoo finance and import the data into a database table.

 

That sounded like an interesting problem so I took up the challenge. The basis of my solution uses the code that Ashvini Sharma has posted here that shows how to download files over HTTP.

Here's everything that happens in the package in order to make this happen and display the results:

  1. Build a URL dynamically using an expression on the @[User::URL] variable using various parameter values within the package. The parameter values are hardcoded here but they could easily be changed at runtime using any one of a number of methods.
  2. Using a slightly modifed version of Ashvini's code the file is downloaded to a location defined by a Connection Manager within the package.
  3. That same file, pointed at using the Connection Manager, is loaded into the SSIS pipeline. Here we simply view the data using a data viewer but of course once it is in the pipeline you can do whatever you want with it.

That's about it really. Here's a screenshot of the package in progress:

 

Hope that's useful to someone. The power to download data over HTTP and process it within SSIS is really powerful. Good luck in using it!

The demo package is attached to this blog post. See the link below.

Comments are welcome!!!

-Jamie

 

Published 31 May 2006 11:46 by jamie.thomson
Attachment(s): 20060531DownloadStockInfo.zip

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Charlie Maitland’s Blog » Blog Archive » SSIS Web Imports said:

May 31, 2006 22:35
 

infysuresh said:

I am getting an error "[] Error: The remote server returned an error: (407) Proxy Authentication Required.". Please help to resolve this.
June 1, 2006 09:09
 

infysuresh said:

Sorry for the previous post. I resolved the issue myself.
June 1, 2006 09:14
 

gopal said:

hw did u solve that authentication problem? you mean secure http site???

September 25, 2007 02:45
 

Rob said:

Hi there,

If you have SQL Server Express 2005 and run this package from command line will you get it required a higher level edition?

Thanks in advance

July 15, 2008 03:56
 

jamie.thomson said:

Rob,

SQL Express doesn't include SSIS. You'll need a higher edition.

-Jamie

July 15, 2008 10:04
 

cadence said:

Jamie,

Can you post the ssis project associated with this solution?

-Edward

cadence@optonline.net

August 24, 2008 04:50
 

jamie.thomson said:

Edward,

A link to the demo package is provided above.

-Jamie

August 26, 2008 08:57

Leave a Comment

(required) 
(optional)
(required) 
Submit

This Blog

Syndication

News

Powered by Community Server (Personal Edition), by Telligent Systems