How to clear then refresh cube in one JSON block?

Cataster 641 Reputation points
2021-01-08T04:31:52.207+00:00

Currently I use the following JSON script to process our tabular cubes on the server (SSAS 2019)

{
  "refresh": {
    "type": "full",
    "objects": [
      {
        "database": "Cube1"
      }
    ]
  }
}

I want to clear and then process the database/cube, all in one JSON script/file.

However, when i execute below script in SSMS:

{
  "refresh": {
    "type": "clearValues",
    "objects": [
      {
        "database": "Cube1"
      }
    ]
  }
}
{
  "refresh": {
    "type": "full",
    "objects": [
      {
        "database": "Cube1"
      }
    ]
  }
}

I get this error:

The JSON DDL request failed with the following error: Additional text encountered after finished reading JSON content: {. Path '', line 11, position 1

I also tried including a comma between the different blocks to separate them but i get a similar error regardless.

So what is the correct way/syntax to combine these two JSON refresh blocks together in one script?

SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,290 questions
0 comments No comments
{count} votes

Accepted answer
  1. Lukas Yu -MSFT 5,821 Reputation points
    2021-01-08T09:51:59.667+00:00

    Hi,

    Why not try : Process : automatic as described in Refresh command (TMSL)

    Back to your original question, you could run the operation sequentially using script :

    {  
    "sequence":  
    {  
    "maxParallelism": 1,  
    "operations": [  
    {  
    "refresh": {  
    "type": "clearValues",  
    "objects": [  
    {  
    "database": "Cube1"  
    }  
    ]  
    }  
    },  
    {  
    "refresh": {  
    "type": "full",  
    "objects": [  
    {  
    "database": "Cube1"  
    }  
    ]  
    }  
    }  
      
    ]  
    }  
    }  
    

    Reference : Sequence command (TMSL)

    Regards,
    Lukas


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    What can I do if my transaction log is full?--- Hot issues November
    How to convert Profiler trace into a SQL Server table -- Hot issues November

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.