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
 General SQL Server Forums
 New to SQL Server Programming
 retrieving data from the internet

Author  Topic 

alecwh22
Starting Member

15 Posts

Posted - 2011-07-26 : 10:11:11
i have a table (call it table1) of the form

|id |url |html |
----------------------------------
|1 |www.blar.com/1 | |
|2 |www.blar.com/2 | |
|3 |www.blar.com/3 | |

ect...

and i want to populate the html column with the html code from the websites listed in the url column. any ideas as to how to acomplish this?

NOTE: i know it could be possible using c# app but wish to avoid that if possible.

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2011-07-26 : 10:59:39
You should use the right tool for the right job. Sql Server is not an http request enginge. Set up a c# app to make the requests and populate your table. You may want to consider saving the html as a file rather than storing it in a table. What will you be doing with the html? If you will be parsing values out of it you will probably want to use your c# app to do that part as well.

Be One with the Optimizer
TG
Go to Top of Page

alecwh22
Starting Member

15 Posts

Posted - 2011-07-27 : 04:51:39
My aim is to extract urls contained within the html and to check your saying its probably possible but a bad idea to do it in sql alone? which is fair enough. but now i must continue to learn CLR :(

many thanks
Alec
Go to Top of Page

dhinasql
Posting Yak Master

195 Posts

Posted - 2011-07-27 : 05:17:49
Yes i agree with TG, Use the C# App web request to get the HTML content and use it through CLR process. CLR is much faster than SQL Engine.
Go to Top of Page
   

- Advertisement -