April 26, 2013 at 9:01 am
Hi All,
I have created the sql job refering to the microsoft article.
http://technet.microsoft.com/en-us/library/cc966392.aspx#XSLTsection129121120120
For the step: Record state change
INSERT INTO dbo.[DB Mirroring State Changes] (
[Event Time],
[Event Description],
[New State],
[Database] )
VALUES (
$(WMI(StartTime)),
'$(WMI(TextData))',
$(WMI(State)),
'$(WMI(DatabaseName))' )
I am getting this error message and sql job is failing:
Unable to start execution of step 2 (reason: The job step contains tokens. For SQL Server 2005 Service Pack 1 or later, you must use the appropriate ESCAPE_xxx macro to update job steps containing tokens before the job can run.). The step failed.
Any help is appreciated. Thanks.
April 26, 2013 at 4:24 pm
Please take a look at :-
April 27, 2013 at 12:19 am
Use the appropriate escape macro, if you dont need to escape any quote marks then the following will apply
INSERT INTO dbo.[DB Mirroring State Changes] (
[Event Time],
[Event Description],
[New State],
[Database] )
VALUES (
$(ESCAPE_NONE(WMI(StartTime))),
$(ESCAPE_NONE(WMI(TextData))),
$(ESCAPE_NONE(WMI(State))),
$(ESCAPE_NONE(WMI(DatabaseName))))
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
April 29, 2013 at 6:57 am
When i execute this statement i am getting the below error message:
INSERT INTO dbo.[DB Mirroring State Changes] (
[Event Time],
[Event Description],
[New State],
[Database] )
VALUES (
$(ESCAPE_NONE(WMI(StartTime))),
$(ESCAPE_NONE(WMI(TextData))),
$(ESCAPE_NONE(WMI(State))),
$(ESCAPE_NONE(WMI(DatabaseName))))
Output:
Msg 102, Level 15, State 1, Line 7
Incorrect syntax near '('.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply