Wouldn't job name be available to you when you create a job? and why
would you want the Job ID? I don't think it conveys much of information.
John
-----Original Message-----
From: S, Sathish K (EM, GECIS) [mailto:Sathish.[Email Address Removed]
Sent: Tuesday, July 29, 2003 8:14 AM
To: LazyDBA.com Discussion
Subject: FW: Getting the JobID and jobname within the steps of the same
JOB
> Hi,
>
> I am trying to automate the alerting to multiple DBAs and monitoring
> people. Hence, want to use "raiserror" with a custom message with the
> details of the server, jobid,jobname, and error message
>
> I know that the server name can be got from @@servername
>
> RAISERROR (99999, 17, 1, @@servername,null,null)
>
> How do I get the jobid, jobname and error message for the failure.
>
> Regards,
>
> Sathish
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To unsubscribe, e-mail: mssqldba-[Email Address Removed] additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page