1
I am sending a request inside a database by SQL Server using Winhttp.WinHTTPRequest. 5.1, the problem is that the request is taking too long and is giving timeout error. I would like to increase the timeout time of SQL Server.
I’m doing it like this at the trial:
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?
Maybe what you should do is revise your query!
– Marconi
The server is not mine, I have no way to optimize the processing.
– Jônatas Trabuco Belotti
But the problem does not seem to be with sqlserver but rather with setting up Winhttp.Winhttprequest, or am I mistaken? So much so that I believe you are not sending by sqlserver but calling a page that uses sql-server in the back end.
– Guilherme Nascimento
No, the request is made by a precedent in SQL Server.
– Jônatas Trabuco Belotti