How to fail SQLjob when we try to run ANALYSISCOMMAND?

  • I have scheduled a job to run the Analysis XMLA script using the ANALYSISCOMMAND subsystem .

    The JobStep succeeds even though I know the Analysis XMLA script errors out if ran in SQL Management studio directly. Is there a way to get the error from the script being ran under the ANALYSISCOMMAND subsytem, or way to write this to an out file, other than running the command as cmdexec?

  • Try adding an output file to the file system by modifying the job step properties. This should give more detailed information.

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • Your suggestion would be useful if i wanted to capture some thing, but before that i want some way that SQL job has to receive the SSAS command and must failed on the same step.

    For ex. if you are calling a stored proc from the SQL job, suppose if what ever the stored proc it is calling has some problem , then job will automatically fail.

    But in my case i will call the SSAS script directly like in the below.

    <Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">

    <Parallel><Process xmlns:xsd="http://www.w3.org/2001/XMLSchema"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2"

    xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2">

    <Object><DatabaseID>PharmGuardWarehouse323232</DatabaseID>

    <DimensionID>Admin Tracking Event</DimensionID></Object>

    <Type>ProcessFull</Type><WriteBackTableCreation>UseExisting</WriteBackTableCreation></Process>

    <Process xmlns:xsd="http://www.w3.org/2001/XMLSchema"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2"

    xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2">

    <Object><DatabaseID>PharmGuardWarehouse323232</DatabaseID><DimensionID>Admin Tracking Event Time3232332</DimensionID></Object><Type>ProcessFull</Type><WriteBackTableCreation>UseExisting</WriteBackTableCreation></Process><Process xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2"><Object><DatabaseID>PharmGuardWarehouse323232</DatabaseID><CubeID>Administrative900</CubeID></Object><Type>ProcessFull</Type><WriteBackTableCreation>UseExisting</WriteBackTableCreation></Process></Parallel></Batch>

    Actually the above script is refering the wrong databases, and wrong objects.If i run the same query on analysisservices, it would fail.

    But the job which is calling the above script is not failing.

    Please help me if some one has an answer for that.

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

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