user6479259
user6479259

Reputation: 47

Automated process Tabular Model Scripting Language (TMSL)

I created my tabular model with SSAS and Now I'm looking for a solution to refresh it automatically. So I have some questions :

could we process our tabular model with a stored procedure T-SQL calling the TMSL script ?

An example will be helpful

Thank's

Upvotes: 1

Views: 1661

Answers (1)

GregGalloway
GregGalloway

Reputation: 11625

Yes. This article explains how to setup a SQL Server linked server that connects to SSAS. Once that's done, you can run this:

declare @xmla varchar(max) = '
{
  "refresh": {
    "type": "full",
    "objects": [
      {
        "database": "YourDatabaseName"
      }
    ]
  }
}
';

exec (@xmla) at SSAS;

This approach lets you write some logic to execute different TMSL scripts daily. For example you could refresh only the current year partition.

If you want to execute a static script then a SQL Agent job is another way to go.

Upvotes: 1

Related Questions