• much easier to do that from an application.

    from sql server 2000, it's difficult to do in TSQL because you must use an object with sp_oacreate to get the text of the web page, and you are limited to 4000 bytes at a time...so if the page is 25K, you need to get 7 "slices" of the web page, one at a time, to get it into sql server.

    I did that for fun in a different thread here on SSC, but it required a separate program i wrote to download the web page selected.

    In my case, I was building a "scraper", so it got a web page and put it in a table in SQL server.

    In order to do this, you'll need to grab the dll from this project and put it in your path or .bin directory for SQL server: the source code, vb6 project, and compiled dll are all in this zip file:

    http://www.stormrage.com/blogpix/WebReader.zip

    [

    this procedure does all the work:

    CREATE FUNCTION dbo.GetWebPage (@webpage varchar(1000)='' )

    RETURNS @webcontents table

    (

    rowid smallint IDENTITY(1,1), --Array index

    pagetext varchar(4000) --Array element contents

    )

    AS

    BEGIN

    DECLARE @hr int,

    @webreader int,

    @Num4K int,

    @i int,

    @contents varchar(4000)

    IF LTRIM(RTRIM(ISNULL(@webpage,''))) =''

    SET @webpage = 'http://www.yahoo.com'

    EXEC @hr = sp_OACreate 'WebReader.Reader', @webreader OUT

    EXEC @hr = sp_OAMethod @webreader, 'GetWebPageContentsAsString',null,@webpage

    EXEC @hr = sp_OAGetProperty @webreader, 'Num4KLengths', @Num4K OUT

    SET @i = 1

    WHILE @i <=@Num4K

    BEGIN

    EXEC @hr = sp_OAGetProperty @webreader, 'PageSlice', @contents OUT, @i

    INSERT INTO @webcontents(pagetext) VALUES(@contents)

    SET @i=@i + 1

    End

    EXEC @hr = sp_OADestroy @webreader

    Return

    End

    select * from dbo.GetWebPage(default)

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!