2011-12-15 35 views

回答

3

是的,您可以使用SQL Server CLR创建您需要的功能。

Introduction to SQL Server CLR

您还可以启用SQL Server的CMD程序,并运行像卷曲发送请求。这不是我会推荐的。

EXEC sp_configure 'show advanced options', 1 
GO 

-- To update the currently configured value for advanced options. 
RECONFIGURE 
GO 

-- To enable the feature. 
EXEC sp_configure 'xp_cmdshell', 1 
GO 

-- To update the currently configured value for this feature. 

RECONFIGURE 
GO 

下载Curl

+0

有其他选择吗?在sql server中没有其他选项可以发送http请求吗? – user960567

+0

不是。任何人,如果我错了,随时关闭我:) – Asken

2

更新

可以执行一个vbs脚本EXEC master..xp_cmdshell 'c:\<file>.vbs',no_output和脚本里面,你可以使用如下代码,found this on SO here

call main() 
sub main() 
    Dim xmlHTTP, url 
    Set xmlHTTP = WScript.CreateObject("Msxml2.XMLHTTP") 
    url = "<url>" 
    xmlHTTP.Open "GET", url, False 
    xmlHTTP.Send "" 
end sub 


您可以使用 CmdExec和像

执行命令

“C:\ Program Files \ Internet Explorer \ iexplore.exe“”http://your-url-here/

+1

这是一个可怕的soution其实! – Asken

+0

哦!你为什么这么认为 ? – Vamsi

+0

@VamsiKrishna,我同意Asken。为什么我需要打开浏览器发送单个请求? – user960567