Respect the original works: reproduced in this article from http://www.cnblogs.com/icycore/p/3532197.html
1.Ole Automation Procedures Server configuration options
When OLE Automation procedures is enabled, calls to sp_OACreate will start the OLE shared execution environment.
Ole Automation Procedures option can be viewed and changed by using the sp_configure system stored proced Ure. "Data-guid=" 39a0a531b1194eeda90b9f2140b44647 "can use   sp_ Configure system stored procedures to view and change ole Automation procedures option.
' Show advanced Options ' 1 'Ole Automation procedures'1; Goreconfigure; GO
View Code
2. Write the SQL code and execute
DECLARE @ServiceUrl asvarchar +) declare @UrlAddress varchar ( -)--webservice address: Starts with HTTP and ends with a slash, for example'http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx/' Set@UrlAddress ='http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx/'declare @FunName varchar ( -)Method name called in--webservice: for example'Getmobilecodeinfo'Set@FunName ='Getmobilecodeinfo'--The following parameters correspond to the parameter names of the 4 parameters in WebService]declare @P1 varchar ( -), @P2 varchar ( -)Set@P1 ='Mobilecode'Set@P2 ='userid'declare @P1_Value varchar ( -), @P2_Value varchar ( -)Set@P1_Value ='13800138000'Set@P2_Value ="'Set@ServiceUrl = @UrlAddress + @FunName +'?'+ @P1 +'='+ @P1_Value +'&'+ @P2 +'='+@P2_Value Declare @Object asintDECLARE @ResponseText asVarchar (8000) Exec sp_OACreate'msxml2.xmlhttp', @Object out; Exec sp_OAMethod @Object,'Open'Null'Get', @ServiceUrl,'false'Exec sp_OAMethod @Object,'Send'Exec sp_OAMethod @Object,'ResponseText', @ResponseText OUTPUT Select @ResponseText Exec sp_OADestroy @ObjectGO
View Code
Be aware that the returned result is an XML encoding with parsing.
Instance of calling WebService in SQL Server