Showing posts with label step. Show all posts
Showing posts with label step. Show all posts

Tuesday, March 20, 2012

Alert for a job step

hi.
I have a job with 5 steps.
I want a custom alert after the first step is executed reagrdless of whether it succeeds or fails on execution. I want to do a net send of the alert only after step1 is completed. How do i do this?
Thank you very much for the help.You can create step 2 as the send alert and go to that step on both success and failure.

You can also call your step step 2
Create step 1 as a failure alert step
Create step 3 as a success alert step
Start the job at step 2 and goto step 1 on failure, step 3 on success.
Step 1 and step 3 can call an SP to send the alert.|||thank you for the reply. Appreciate your responses and help in this forum.
Yes, I have made a custom error message/code and an custom alert for that error code.
And all i do is raiserror with the custom error code passed as parameter in the job step. this is captured by the alert and the net send is generated. By the way how do i send an alert from an SP?:confused:

Alert doesn't start

Hi all,
I have the following problem. I need to start a tarce in a job step. I
created the trace and it works properly. I scripted it and ran it in Query
Analyzer. Although the status displayed by SELECT * FROM ::
fn_trace_getinfo(default) says the trace is started (status=1), nothing
happens. What can be the problem?
Thanks in advance.
Sincerely,
Kolos
What do you mean, when you say nothing happens? Are you trying to open the
output trace file when the trace is running? Then it may not work.
You have to stop the trace, to open the file to which trace is currently
logging.
You have to use sp_trace_setstatus to stop and close the trace, before
opening the output file.
You may find my following article useful:
http://vyaskn.tripod.com/server_side...sql_server.htm
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Kolos" <Kolos@.discussions.microsoft.com> wrote in message
news:60E1CCF1-AF58-46FA-BB1F-B58C10C3115E@.microsoft.com...
Hi all,
I have the following problem. I need to start a tarce in a job step. I
created the trace and it works properly. I scripted it and ran it in Query
Analyzer. Although the status displayed by SELECT * FROM ::
fn_trace_getinfo(default) says the trace is started (status=1), nothing
happens. What can be the problem?
Thanks in advance.
Sincerely,
Kolos
|||Well, thanks. The size of the file was 0 KB until the trace was stopped. I
feel a bit stupid... Thanks, anyway.
"Narayana Vyas Kondreddi" wrote:

> What do you mean, when you say nothing happens? Are you trying to open the
> output trace file when the trace is running? Then it may not work.
> You have to stop the trace, to open the file to which trace is currently
> logging.
> You have to use sp_trace_setstatus to stop and close the trace, before
> opening the output file.
> You may find my following article useful:
> http://vyaskn.tripod.com/server_side...sql_server.htm
> --
> HTH,
> Vyas, MVP (SQL Server)
> http://vyaskn.tripod.com/
>
> "Kolos" <Kolos@.discussions.microsoft.com> wrote in message
> news:60E1CCF1-AF58-46FA-BB1F-B58C10C3115E@.microsoft.com...
> Hi all,
> I have the following problem. I need to start a tarce in a job step. I
> created the trace and it works properly. I scripted it and ran it in Query
> Analyzer. Although the status displayed by SELECT * FROM ::
> fn_trace_getinfo(default) says the trace is started (status=1), nothing
> happens. What can be the problem?
> Thanks in advance.
> Sincerely,
> Kolos
>
>

Alert doesn't start

Hi all,
I have the following problem. I need to start a tarce in a job step. I
created the trace and it works properly. I scripted it and ran it in Query
Analyzer. Although the status displayed by SELECT * FROM ::
fn_trace_getinfo(default) says the trace is started (status=1), nothing
happens. What can be the problem?
Thanks in advance.
Sincerely,
KolosWhat do you mean, when you say nothing happens? Are you trying to open the
output trace file when the trace is running? Then it may not work.
You have to stop the trace, to open the file to which trace is currently
logging.
You have to use sp_trace_setstatus to stop and close the trace, before
opening the output file.
You may find my following article useful:
http://vyaskn.tripod.com/server_side_tracing_in_sql_server.htm
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Kolos" <Kolos@.discussions.microsoft.com> wrote in message
news:60E1CCF1-AF58-46FA-BB1F-B58C10C3115E@.microsoft.com...
Hi all,
I have the following problem. I need to start a tarce in a job step. I
created the trace and it works properly. I scripted it and ran it in Query
Analyzer. Although the status displayed by SELECT * FROM ::
fn_trace_getinfo(default) says the trace is started (status=1), nothing
happens. What can be the problem?
Thanks in advance.
Sincerely,
Kolos|||Well, thanks. The size of the file was 0 KB until the trace was stopped. I
feel a bit stupid... Thanks, anyway.
"Narayana Vyas Kondreddi" wrote:
> What do you mean, when you say nothing happens? Are you trying to open the
> output trace file when the trace is running? Then it may not work.
> You have to stop the trace, to open the file to which trace is currently
> logging.
> You have to use sp_trace_setstatus to stop and close the trace, before
> opening the output file.
> You may find my following article useful:
> http://vyaskn.tripod.com/server_side_tracing_in_sql_server.htm
> --
> HTH,
> Vyas, MVP (SQL Server)
> http://vyaskn.tripod.com/
>
> "Kolos" <Kolos@.discussions.microsoft.com> wrote in message
> news:60E1CCF1-AF58-46FA-BB1F-B58C10C3115E@.microsoft.com...
> Hi all,
> I have the following problem. I need to start a tarce in a job step. I
> created the trace and it works properly. I scripted it and ran it in Query
> Analyzer. Although the status displayed by SELECT * FROM ::
> fn_trace_getinfo(default) says the trace is started (status=1), nothing
> happens. What can be the problem?
> Thanks in advance.
> Sincerely,
> Kolos
>
>

Alert doesn't start

Hi all,
I have the following problem. I need to start a tarce in a job step. I
created the trace and it works properly. I scripted it and ran it in Query
Analyzer. Although the status displayed by SELECT * FROM ::
fn_trace_getinfo(default) says the trace is started (status=1), nothing
happens. What can be the problem?
Thanks in advance.
Sincerely,
KolosWhat do you mean, when you say nothing happens? Are you trying to open the
output trace file when the trace is running? Then it may not work.
You have to stop the trace, to open the file to which trace is currently
logging.
You have to use sp_trace_setstatus to stop and close the trace, before
opening the output file.
You may find my following article useful:
http://vyaskn.tripod.com/server_sid..._sql_server.htm
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Kolos" <Kolos@.discussions.microsoft.com> wrote in message
news:60E1CCF1-AF58-46FA-BB1F-B58C10C3115E@.microsoft.com...
Hi all,
I have the following problem. I need to start a tarce in a job step. I
created the trace and it works properly. I scripted it and ran it in Query
Analyzer. Although the status displayed by SELECT * FROM ::
fn_trace_getinfo(default) says the trace is started (status=1), nothing
happens. What can be the problem?
Thanks in advance.
Sincerely,
Kolos|||Well, thanks. The size of the file was 0 KB until the trace was stopped. I
feel a bit stupid... Thanks, anyway.
"Narayana Vyas Kondreddi" wrote:

> What do you mean, when you say nothing happens? Are you trying to open the
> output trace file when the trace is running? Then it may not work.
> You have to stop the trace, to open the file to which trace is currently
> logging.
> You have to use sp_trace_setstatus to stop and close the trace, before
> opening the output file.
> You may find my following article useful:
> http://vyaskn.tripod.com/server_sid..._sql_server.htm
> --
> HTH,
> Vyas, MVP (SQL Server)
> http://vyaskn.tripod.com/
>
> "Kolos" <Kolos@.discussions.microsoft.com> wrote in message
> news:60E1CCF1-AF58-46FA-BB1F-B58C10C3115E@.microsoft.com...
> Hi all,
> I have the following problem. I need to start a tarce in a job step. I
> created the trace and it works properly. I scripted it and ran it in Query
> Analyzer. Although the status displayed by SELECT * FROM ::
> fn_trace_getinfo(default) says the trace is started (status=1), nothing
> happens. What can be the problem?
> Thanks in advance.
> Sincerely,
> Kolos
>
>

Saturday, February 25, 2012

Agent Jobs Failure

I have setup the sending of an email when a job fails, but the Messages
portion of the email only includes the step that errored and a generic
message, how can I get the email to also contain the actual error message?
--
HaroldsHi Harolds,
Thank you for your post.
Based on my scope, you can not include the detail error message directly.
Please build up a custom stored procedure to send the email.
Here is an article for your reference:
http://www.orcsweb.com/articles/sendmailsql.aspx
http://support.microsoft.com/default.aspx?scid=kb;en-us;312839&sd=tech
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Thanks that did the trick.
--
Harolds
"Wei Lu" wrote:
> Hi Harolds,
> Thank you for your post.
> Based on my scope, you can not include the detail error message directly.
> Please build up a custom stored procedure to send the email.
> Here is an article for your reference:
> http://www.orcsweb.com/articles/sendmailsql.aspx
> http://support.microsoft.com/default.aspx?scid=kb;en-us;312839&sd=tech
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================> This posting is provided "AS IS" with no warranties, and confers no rights.
>|||Hi Harolds,
Thank you for the update. Glad to hear the information is helpful.
If you have any questions or concerns, please feel free to let me know.
Have a nice day!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.

Agent Jobs Failure

I have setup the sending of an email when a job fails, but the Messages
portion of the email only includes the step that errored and a generic
message, how can I get the email to also contain the actual error message?
--
HaroldsHi Harolds,
Thank you for your post.
Based on my scope, you can not include the detail error message directly.
Please build up a custom stored procedure to send the email.
Here is an article for your reference:
http://www.orcsweb.com/articles/sendmailsql.aspx
http://support.microsoft.com/defaul...;312839&sd=tech
Sincerely,
Wei Lu
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.|||Thanks that did the trick.
--
Harolds
"Wei Lu" wrote:

> Hi Harolds,
> Thank you for your post.
> Based on my scope, you can not include the detail error message directly.
> Please build up a custom stored procedure to send the email.
> Here is an article for your reference:
> http://www.orcsweb.com/articles/sendmailsql.aspx
> http://support.microsoft.com/defaul...;312839&sd=tech
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ========================================
==========
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>|||Hi Harolds,
Thank you for the update. Glad to hear the information is helpful.
If you have any questions or concerns, please feel free to let me know.
Have a nice day!
Sincerely,
Wei Lu
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.