Forum Discussion

issam_qasas's avatar
issam_qasas
Copper Contributor
Oct 21, 2024

error when trying to execute sp_invoke_external_rest_endpoint

hi team
i am using the following sql server version
Microsoft Azure SQL Data Warehouse - 10.0.33054.0 Jul 9 2024 00:12:38 Copyright (c) Microsoft Corporation
my college told me this is Azure Dedicated pool , but when i try this statement
SERVERPROPERTY('EngineEdition') it gave me the value of 6

now the issue is :-
this is my code , which is the REST API is working fine from postman tool
------------------------------------------------------
DECLARE @URL NVARCHAR(255) = 'https://date.nager.at/api/v3/PublicHolidays/2024/ZA'
-- HTTP Request Parameters
DECLARE @Object AS INT;
DECLARE Hr INT;
DECLARE @JSONResponse as NVARCHAR(max);

--------------------------------------------------------------------------------
-- Perform HTTP GET Request to endpoint
EXEC Hr = sp_invoke_external_rest_endpoint
@url = @URL,
@method = 'GET',
@response = @JSONResponse output;

SELECT Hr AS ReturnCode, @JSONResponse AS Response


---------------------------------------------------------------------
it gave me the following error :-

Msg 103010, Level 16, State 1, Line 1
Parse error at line: 10, column: 1: Incorrect syntax near 'EXEC'.

 

any suggestions ????

 

No RepliesBe the first to reply

Resources