Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

DBmirroring state change SQL job Expand / Collapse
Author
Message
Posted Friday, April 26, 2013 9:01 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Yesterday @ 1:29 PM
Points: 395, Visits: 1,992
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.

Post #1447050
Posted Friday, April 26, 2013 4:23 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, September 23, 2014 10:34 AM
Points: 832, Visits: 1,177
Please take a look at :-
http://msdn.microsoft.com/en-us/library/ms175575.aspx
Post #1447195
Posted Saturday, April 27, 2013 12:19 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:38 AM
Points: 6,416, Visits: 13,797
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"
Post #1447224
Posted Monday, April 29, 2013 6:57 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Yesterday @ 1:29 PM
Points: 395, Visits: 1,992
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 '('.
Post #1447489
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse