sql >> Database teknologi >  >> RDS >> Sqlserver

Kald en API fra SQL Server lagret procedure

Se venligst et link for flere detaljer.

Declare @Object as Int;
Declare @ResponseText as Varchar(8000);

Code Snippet
Exec sp_OACreate 'MSXML2.XMLHTTP', @Object OUT;
Exec sp_OAMethod @Object, 'open', NULL, 'get',
                 'http://www.webservicex.com/stockquote.asmx/GetQuote?symbol=MSFT', --Your Web Service Url (invoked)
                 'false'
Exec sp_OAMethod @Object, 'send'
Exec sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT

Select @ResponseText

Exec sp_OADestroy @Object


  1. Sådan sammenkædes strenge i MySQL med CONCAT()

  2. Salesforce SOQL fra Microsoft Office

  3. SQL:Få oprettet registreringer i tidsinterval for bestemte datoer

  4. SQL Server 2016:Importer data