1

I am trying to call the API service from Azure SQL Managed Instance database and I am getting the error below. However, when I execute from my local SQL server, it works fine.

I used the queries below:

USE MASTER
GO
sp_configure 'show advanced options', 1 
GO 
RECONFIGURE; 
GO 
sp_configure 'Ole Automation Procedures', 1 
GO 
RECONFIGURE; 

GO 
sp_configure 'show advanced options', 0
GO 
RECONFIGURE; 

Exec sp_OACreate 'MSXML2.XMLHTTP', @Object OUT;
Exec sp_OAMethod @Object, 'open', NULL, 'post',
'https://localhost:7071/api/HashPwd', 
'false'
Exec sp_OAMethod @Object, 'send'
Exec sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT
Select @ResponseText

Error ---
Msg 17750, Level 16, State 0, Procedure sp_OACreate, Line 1 [Batch Start Line 0]
Could not load the DLL odsole70.dll, or one of the DLLs it references. Reason: 2(The system cannot find the file specified.).
Msg 17750, Level 16, State 0, Procedure sp_OAMethod, Line 1 [Batch Start Line 0]
Could not load the DLL odsole70.dll, or one of the DLLs it references. Reason: 2(The system cannot find the file specified.).
Msg 17750, Level 16, State 0, Procedure sp_OAMethod, Line 1 [Batch Start Line 0]
Could not load the DLL odsole70.dll, or one of the DLLs it references. Reason: 2(The system cannot find the file specified.).
Msg 17750, Level 16, State 0, Procedure sp_OAMethod, Line 1 [Batch Start Line 0]
Could not load the DLL odsole70.dll, or one of the DLLs it references. Reason: 2(The system cannot find the file specified.).

How do I fix the error?

user5305519
  • 3,008
  • 4
  • 26
  • 44
Hemant Sudehely
  • 49
  • 1
  • 10
  • Is that you want to OLE Automation Stored Procedures? If so, we cannot use it in Azure. We just can use it on-premise SQL. For more details, please refer to https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/ole-automation-stored-procedures-transact-sql?view=sql-server-ver15 – Jim Xu May 26 '20 at 08:12

1 Answers1

0

If you want to use OLE Automation Stored Procedures, we just can use it on-premise SQL server. We cannot use it in Azure SQL database or Azure SQL managed instance. For more details, please refer to the document and the document

Jim Xu
  • 21,610
  • 2
  • 19
  • 39