我在“内存”模式下创建了一个表格项目。我想每天刷新数据。有没有办法安排一项每天刷新数据的工作?
答案 0 :(得分:0)
您的选择相当有限
您可以从azure功能触发刷新
#r "D:\home\site\wwwroot\yourfunccatalog\bin\Microsoft.AnalysisServices.DLL"
#r "D:\home\site\wwwroot\yourfunccatalog\bin\Microsoft.AnalysisServices.Core.DLL"
#r "D:\home\site\wwwroot\yourfunccatalog\bin\Microsoft.AnalysisServices.Tabular.DLL"
using System;
public static void Run(string input, TraceWriter log)
{
var server = new Microsoft.AnalysisServices.Tabular.Server();
server.Connect("Provider=MSOLAP;Data Source=asazure://[...];User ID=[...];Password=[...];Catalog=[...];Persist Security Info=True; Impersonation Level=Impersonate;");
var model = server.Databases[0].Model;
model.RequestRefresh(Microsoft.AnalysisServices.Tabular.RefreshType.Full);
model.SaveChanges();
server.Disconnect();
}
在运行之前你必须上传dll(在我的情况下是c:\ Program Files(x86)\ Microsoft SQL Server \ 130 \ SDK \ Assemblies)
xmla脚本应该如下所示(尚未测试过!)
<Statement xmlns="urn:schemas-microsoft-com:xml-analysis">
{
"refresh": {
"type": "full",
"objects": [
{
"database": "Your database name here"
}
]
}
}
</Statement>