Sample code for 30+ languages & platforms
SQL Server

Setting a Maximum URL Length

See more Spider Examples

The MaxUrlLen property prevents the spider from retrieving URLs that grow too long. The default value of MaxUrlLen is 300.

Chilkat SQL Server Downloads

SQL Server
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    DECLARE @spider int
    EXEC @hr = sp_OACreate 'Chilkat.Spider', @spider OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    EXEC sp_OAMethod @spider, 'Initialize', NULL, 'www.chilkatsoft.com'

    -- Add the 1st URL:
    EXEC sp_OAMethod @spider, 'AddUnspidered', NULL, 'http://www.chilkatsoft.com/'

    -- This example demonstrates setting the MaxUrlLen property
    -- Do not add URLs longer than 250 characters to the "unspidered" queue:
    EXEC sp_OASetProperty @spider, 'MaxUrlLen', 250

    -- ..

    EXEC @hr = sp_OADestroy @spider


END
GO