| Author |
Topic |
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2004-08-02 : 07:47:20
|
| Hi,I've been trying to run an application that will send mail when invoked by an alert.1. Is there something wrong with this job step? as cmdexec- c:\mail\mail.exe "parameter"2. How to I pass the alert message as parameter in #1 question?Btw, sqlmail is not an option.Thanks in advance, |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-08-02 : 10:17:35
|
| ???? Why don't you give us the exact command you're passing. Is this wrapped in a stored procedure I'm assuming? How are you getting the alerts to use it?MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
ehorn
Master Smack Fu Yak Hacker
1632 Posts |
Posted - 2004-08-02 : 14:56:49
|
| Here is another alternative:http://support.microsoft.com/default.aspx?scid=kb;en-us;312839&sd=tech |
 |
|
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2004-08-02 : 18:27:05
|
Hi Derreck,that's it, it's a sql job step. i tried the command on command prompt and it works but when i pass it as a job step, it doesn't.is the syntax wrong? or some special way of calling exe files with parameters?quote: Originally posted by derrickleggett ???? Why don't you give us the exact command you're passing. Is this wrapped in a stored procedure I'm assuming? How are you getting the alerts to use it?MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA.
|
 |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-08-03 : 23:27:13
|
| What is the syntax for the mail.exe program. Can you run "mail.exe /?" and see what the parameters are? Also, I don't understand what you mean by passing a parameter in. Are you just calling a different job for every single alert with a hardcoded error message where you have "parameter" in your example? Are you passing something to the job as a parameter? Are you creating the job dynamically?Shoot me. I'm slow. :)MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2004-08-04 : 05:10:34
|
Hi Derreck,I've created an exe which accepts a parameter used for the mail information.I've tested this outside sql and it works fine. So I created a job and a single step. The step is cmdexec and I just use the line i posted before. Is my syntax wrong? SQL doesn't show any errors even on the log files.About the parameter, that was my second question. How do I retrieve sql alert information, are these saved on a system table? if yes, can you please tell me?thanks a bunch,jenquote: Originally posted by derrickleggett What is the syntax for the mail.exe program. Can you run "mail.exe /?" and see what the parameters are? Also, I don't understand what you mean by passing a parameter in. Are you just calling a different job for every single alert with a hardcoded error message where you have "parameter" in your example? Are you passing something to the job as a parameter? Are you creating the job dynamically?Shoot me. I'm slow. :)MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA.
|
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2004-08-04 : 05:28:21
|
| And here's another one, basically the same as Taras link but using Aspemail instead of JMail:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=36293 |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2004-08-09 : 22:41:00
|
Hi,Thanks for your suggestions but I'm not looking for an alternative to sqlmail, my question is if the syntax i posted is incorrect. I can't seem to get it to run in a job. The exe file accepts a string parameter.the other question is if there is a system table wherein all alert messages are saved, I'd like to use this also for my parameters.Please help....quote: Originally posted by Lumbago And here's another one, basically the same as Taras link but using Aspemail instead of JMail:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=36293
|
 |
|
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2004-08-09 : 23:17:52
|
| I guess we misunderstood your subject then.you never answered derek's question regarding the syntax for the mail.exe app that you are using.You are probably better off trying to use one of the alternatives we posted for you. Those solutions are tested and proven to work.-ec |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2004-08-10 : 02:44:38
|
Hi,i did not understand derek's question regarding syntax but i did explain the logic of the application.Anyways, just found the answer, tnx. It was kinda weird though, i scripted the job instead of using the EM wizard and it worked fine.quote: Originally posted by eyechart I guess we misunderstood your subject then.you never answered derek's question regarding the syntax for the mail.exe app that you are using.You are probably better off trying to use one of the alternatives we posted for you. Those solutions are tested and proven to work.-ec
|
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2004-08-10 : 05:00:00
|
| btw, do you know which systable can give me the description for message_id under sysalerts?thanks so much |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2004-08-10 : 06:47:03
|
It's on the sysmessages under master db, problem now is how to pass the description as a parameter or even for lookup.any ideas?quote: Originally posted by jen btw, do you know which systable can give me the description for message_id under sysalerts?thanks so much
|
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2004-08-11 : 02:48:10
|
| Hi,I think I got this resolved. For those who want to know, i performed a lookup on msdb..sysjobhistory and msdb..sp_get_composite_job_info (thanks Derrick), and passed my criteria to the exe file for an automatic response to any job that fails. If the job still 'refuses' to start then I send a mail to operators for 'manual resolution'.thank you so much.... |
 |
|
|
|