Sample code for 30+ languages & platforms
SQL Server

Example: Http.GetDomain method

Demonstrates the GetDomain method.

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 @http int
    EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @domain nvarchar(4000)
    EXEC sp_OAMethod @http, 'GetDomain', @domain OUT, 'https://chilkatsoft.com/refdoc/csharp.asp'

    PRINT @domain

    -- Output: chilkatsoft.com

    EXEC @hr = sp_OADestroy @http


END
GO