First, enable sp_configureshowadvancedoptions, 1; GORECONFIGURE; GOsp_configureOleAutomationProcedures, 1; GORECONFIGURE; GOEXECsp_configureOleAutomationProcedures; GO and then write the stored procedure: CREATEPROCEDU
First, enable sp_configure 'show advanced options', 1; go reconfigure; GO sp_configure 'ole Automation Procedures ', 1; go reconfigure; go exec sp_configure 'ole Automation Procedures '; GO then writes the stored procedure: CREATE PROCEDU
First:
Enable extended stored procedure Permissions
Sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
Sp_configure 'ole Automation Procedures ', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'ole Automation Procedures ';
GO
Then write the stored procedure:
Create procedure [dbo]. [SP_HTTP]
@ Parametro varchar (10) = NULL
AS
DECLARE @ obj INT
DECLARE @ sUrl varchar (200)
DECLARE @ response INT
SET @ sUrl = 'HTTP: // localhost/test/test.html? Id = '+ @ Parametro
EXEC sp_OACreate 'msxml2. serverxmlhttp', @ obj OUT
EXEC sp_OAMethod @ obj, 'open', NULL, 'get', @ sUrl, false
EXEC sp_OAMethod @ obj, 'send'
EXEC sp_OAGetProperty @ obj, 'responsetext ', @ response OUT
SELECT @ response [response]
EXEC sp_OADestroy @ obj
RETURN
Access httpRequestExtended Stored Procedure required
However, we can see that using the extended storage process is dangerous on the Internet.
What security measures should be taken?
I have not studied much. After all, sqlserver is just a play.
You probably need to assign permissions. These extended functions are public by default.