简体   繁体   中英

How to do a RequestRefresh for a specific SSAS partition through Microsoft.AnalysisServices in C#

I'm familiar with a 'Full' Database Table refresh via the RefreshType.Full refresh type using the Microsoft.AnalysisServices.Tabular namespace:

using var server = new Server();
server.Connect("MyConnectionString");
var db = server.Databases.FindByName("MyDatabaseName");
db.Model.Tables["MyTableName"].RequestRefresh(RefreshType.Full);

Say for example, the MyTableName database table has three partitions ( Partition 1 , Partition 2 , and Partition 3 ).

If I didn't want to do the full database table refresh, but rather only a single partition within that database table, how would one do this syntactically?

first get the table object

var table = db.Model.Tables["MyTableName"]

the table object has the collection of partitions

var partion = table.Partitions["Partition 2"];

the partition object can be "refreshed" using RequestRefresh method

partition.RequestRefresh(Microsoft.AnalysisServices.Tabular.RefreshType.Full);

The actual process will happen when the SaveChanges method is called on the model

var result = db.Model.SaveChanges();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM