Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DBmirroring state change SQL job


DBmirroring state change SQL job

Author
Message
muth_51
muth_51
Mr or Mrs. 500
Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)

Group: General Forum Members
Points: 532 Visits: 2862
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.
Neeraj Dwivedi
Neeraj Dwivedi
SSC Eights!
SSC Eights! (887 reputation)SSC Eights! (887 reputation)SSC Eights! (887 reputation)SSC Eights! (887 reputation)SSC Eights! (887 reputation)SSC Eights! (887 reputation)SSC Eights! (887 reputation)SSC Eights! (887 reputation)

Group: General Forum Members
Points: 887 Visits: 1319
Please take a look at :-
http://msdn.microsoft.com/en-us/library/ms175575.aspx
Perry Whittle
Perry Whittle
SSCrazy Eights
SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)

Group: General Forum Members
Points: 8782 Visits: 16555
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" ;-)
muth_51
muth_51
Mr or Mrs. 500
Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)Mr or Mrs. 500 (532 reputation)

Group: General Forum Members
Points: 532 Visits: 2862
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 '('.

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search