August 7, 2007 at 3:04 pm
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
August 8, 2007 at 9:37 am
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. 😉
August 9, 2007 at 8:00 am
In order to the the $(ESCAPE_NONE(JOBID)) to work you need SQL Server 2005 SP1. After I installed the SP1 it worked.
Thanks
August 10, 2007 at 8:41 am
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