AMO OLAP QueryBinding

我只是一个虾纸丫 提交于 2019-12-20 06:28:25

问题


Depending on business logic sometimes I need to change source table for my Customer dimension in Cube.

Previously I was changing structure of cube using the following code:

    MyServerDataSourceView.Schema.Tables["DimCustomers"].ExtendedProperties["QueryDefinition"] = "new query";
    MyServerDataSourceView.Update(); // update to new definition
    DimCustomer.Process(ProcessType.ProcessAdd, EF);
    MyServerDataSourceView.Schema.Tables["DimCustomers"].ExtendedProperties["QueryDefinition"] = "old regularquery";
    MyServerDataSourceView.Update(); // revert back to old definition

But it is not trustful. Sometimes it doesn't revert back query definition.

Visual Studio shows that there is possibility to use queryBinding.

I was trying such code:

string queryAdd = "SELECT [a],[b],[c] FROM ase.newtable";

QueryBinding queryBinding = new QueryBinding();
queryBinding.QueryDefinition = queryAdd;
DimCustomer.Process(ProcessType.ProcessAdd, queryBinding);

And get the following error which doesn't say much:

Warning: 0x80019002 at ProcessAdd Customer Dimension - Sequence Container: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.

I was trying to study Microsoft documentation but haven't found there any examples or clear explanation.

来源:https://stackoverflow.com/questions/51286842/amo-olap-querybinding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!