I have a SSIS package to perform incremental processing of the cube. In the sequence container in this package, we have a script task to count the number of rows.
and the code in script task is as follows :
public void Main()
{
string connectionString = "Data Source=localhost;PROVIDER=MSOLAP;Impersonation Level=Impersonate;Catalog=EcovaPlatform";
connectionString = connectionString.Replace("localhost", Dts.Variables["User::CubeServer1"].Value.ToString()).Replace("EcovaPlatform", Dts.Variables["User::CubeName1"].Value.ToString());
string queryString = "evaluate row(\"count\", countrows(BillDetail))";
AdomdConnection connection = new AdomdConnection(connectionString);
connection.Open();
AdomdCommand cmd = new AdomdCommand(queryString);
cmd.Connection = connection;
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
Dts.Variables["CubeBillDetailRowCount1"].Value = Convert.ToInt64(reader[0]);
}
}
Dts.TaskResult = (int)ScriptResults.Success;
But every once in a while, this script task(here I am assuming its the script task) fails. It throws out the following error:
Source Name: Cube Table RowCount Error Code: 1 Error Description: Exception has been thrown by the target of an invocation.
Now I dont know how to fix this issue. So I am turning to you good folks, to guide me in the right direction. If somebody wants to look at the XMLA script, I can post that as well. Thanks.