Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mattboy_slim
Yak Posting Veteran
72 Posts |
Posted - 2009-03-02 : 17:37:12
|
Thanks to yosiasz and Peso I have a SQL agent job that does what I need it to do. However, it is possible for the following script to be followed by a string that does a POST to a web page? I want to send an email following the addition of an alert.INSERT tb_alerts ( f_alertname, f_alertgenerated, f_machineaffected )SELECT 'Machine Not Reporting', GETDATE(), l.f_itemGUIDFROM tb_locationsmachines AS xWHERE l.f_machinelastreported < DATEADD(MINUTE, -15, GETDATE()) AND NOT EXISTS (SELECT * FROM tb_alerts AS a WHERE a.f_machineaffected = l.f_itemGUID) I have no idea if it is possible to do a form POST from TSQL, so if not, I need to find an alternate method to email a user when an alert is generated.Essentially, after all is done, I'd like to hit a page like this: http://someurl.com/_functions/email_alerts.aspThanks in advance,Matt |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
mattboy_slim
Yak Posting Veteran
72 Posts |
Posted - 2009-03-03 : 09:53:31
|
| OK, I've been researching and reading for a few hours on Database Mail. It looks like it is going to be a leap to get to that point, and definitely not something I can do here in a day. I will get there, but it may take me some time, since I'm completely new to T-SQL.So are you telling me that it isn't possible to post to an ASP page? There may be other benefits of doing this also, such as being able to call any external executable (IPCONFIG, VNC, etc). |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-03-03 : 10:09:43
|
| another way is to use sent mail task available in ssis. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
mattboy_slim
Yak Posting Veteran
72 Posts |
Posted - 2009-03-03 : 11:21:54
|
| Sorry, I understand that wasn't very clear. Can I make the script hit a web page, or visit a URL?EDIT: Another option is to use the script to launch an application. If I can launch an application, such as cURL, then I can use that to visit the web page. |
 |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2009-03-03 : 12:14:59
|
| you might have to look into system extended procedures. You can create extended procedures in your favourite programming language and deploy it to your database and do what you want it to do. That is a lot of work so you might be better off going the route of the experts' suggestion in this forum. |
 |
|
|
|
|
|
|
|