Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to send a http request from within a SP

Status
Not open for further replies.

tony4x4

Technical User
May 14, 2002
13
0
0
ZA
Hi,

Can anyone tell me if it is possible to send a HTTP Request from with a Stored Procedure. Based on certain conditions I will build a string that need to be sent to a http request which will send a SMS. i.e. If a new record has been added to a SQL database then
Thanks in advance.
 
You might try this (no idea what would happen) ..

I know you can open a url (eg our favourite forums) from command-line with this:

rundll32 url.dll,FileProtocolHandler
You could put your request in the http spot and call with xp_cmdshell:

exec master..xp_cmdshell 'rundll32 url.dll,FileProtocolHandler http:...'

Caution: I dont know whether this would leave a browser or something open or hung on your server.
 
I would recommend getting http_Get.exe (you can find it on google). You would normally use this to request files and download them from the net via command prompt. It can be used via xp_cmdshell to call pages on the net to trigger actions. And it won't leave anything open when it does. You can also redirect the response from the web server to a file, process it and do additional actions based on the response in the file.

Denny

--Anything is possible. All it takes is a little research. (Me)
 
Sounds just like what I would love to put on my intra-nets file server, NOT. Another great reason to avoid dynamic SQL and disable xp_cmdshell.
-Karl

[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top