Wednesday, March 21, 2012

Passing Arguments from an Alert to a SQL Server Job

I have an alert that will execute a job. Is there a way to pass parameters
from an alert to a sql job?
Thanks,
KenYou can not pass parameters to a job, but you can insert a number of
different tokens in the text of the jobstep. These tokens will be replaced
with items like the database name, error message, current time etc when the
job is executed by the alert. This will work for any jobstep, T-SQL, CmdExec
etc. You can find the syntax in the topic for sp_add_jobstep in Books
Online.
--
Jacco Schalkwijk
SQL Server MVP
"Ken" <Ken@.discussions.microsoft.com> wrote in message
news:CDF1CA50-8308-42EC-9F0B-7D5DC49F2307@.microsoft.com...
>I have an alert that will execute a job. Is there a way to pass parameters
> from an alert to a sql job?
> Thanks,
> Ken

No comments:

Post a Comment