I am sending a request within a procedure by SQL Server using WinHTTP.WinHTTPRequest.5.1, the problem is that the request is taking too long and this is giving a timeout error. I would like to increase the SQL Server timeout time.
I'm doing this in the procedure:
exec sp_OACreate 'WinHTTP.WinHTTPRequest.5.1', @Object out;
exec sp_OAMethod @Object, 'open', NULL, 'POST', @url, 'false';
exec sp_OAMethod @Object, 'setRequestHeader', null, 'Content-Type', 'application/json';
exec sp_OAMethod @Object, 'send', null, @Body;
exec sp_OAMethod @Object, 'status', @status output;
exec sp_OAMethod @Object, 'responseText', @ResponseText output;
exec sp_OADestroy @Object;
Does anyone know how to set the timeout?