Job Tokens - $(ESCAPE_NONE(JOBID))

  • I am having problems getting SQL 2005 to work with tokens.

    I am using the following in the last step of a job.

    EXEC sp_DBA_job_notification  $(ESCAPE_NONE(JOBID))

    When I run the job it fails on step 2 with the message of, "Unable to start execution of step 2 (reason: line(1): Syntax error). The step failed."  I am running SQL 2005 on Window Server 2003 standard edition with service pack 2.  When I use a job id in the step instead of the $(ESCAPE_NONE(JOBID)) the step completes.  I have also tried using [JOBID] but this doesn't work either.

    Thanks

     

  • Maybe CONVERT(uniqueidentifier, $(ESCAPE_NONE(JOBID))) will work.  If not, try assigning the value to a local variable first or printing it out before passing it to the procedure.  Something in http://technet.microsoft.com/en-us/library/ms175575.aspx might help. 

    RandyHelpdesk: Perhaps Im not the only one that does not know what you are doing. 😉

  • In order to the the $(ESCAPE_NONE(JOBID)) to work you need SQL Server 2005 SP1.  After I installed the SP1 it worked.

    Thanks

  • Is there a reason NOT to update to SP2?

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply