sql-serverpowershellazure-powershellazure-analysis-servicesanalysisservices

The key didn't match any rows in the table


I'm attempting to refresh my Azure Analysis Services Model using the PowerShell command below.

Invoke-ProcessASDatabase -Server $ServerName -DatabaseName $DatabaseName –RefreshType Full -Credential $cred

Problem

I get an error message back, however it isn't very helpful. Does anyone know how to find out which part of my model is broken?

Invoke-ProcessASDatabase : Failed to save modifications to the server. Error returned: 'The key didn't match any rows in the table.. The exception was raised by the IDbCommand interface.

Technical Details: RootActivityId: 7b0af12c-c9cf-47f9-8abb-9aaff8f0f6f5 Date (UTC): 4/26/2019 3:21:48 PM The command has been canceled.. The exception was raised by the IDbCommand interface. The command has been canceled.. The exception was raised by the IDbCommand interface. The command has been canceled.. The exception was raised by the IDbCommand interface. The command has been canceled.. The exception was raised by the IDbCommand interface. The command has been canceled.. The exception was raised by the IDbCommand interface. The command has been canceled.. The exception was raised by the IDbCommand interface. The command has been canceled.. The exception was raised by the IDbCommand interface. The command has been canceled.. The exception was raised by the IDbCommand interface. The command has been canceled.. The exception was raised by the IDbCommand interface. The command has been canceled.. The exception was raised by the IDbCommand interface. The command has been canceled.. The exception was raised by the IDbCommand interface. The command has been canceled.. The exception was raised by the IDbCommand interface. The current operation was cancelled because another operation in the transaction failed. The command has been canceled.. The exception was raised by the IDbCommand interface. The command has been canceled.. The exception was raised by the IDataReader interface. The command has been canceled.. The exception was raised by the IDataReader interface. '. At line:24 char:1 + Invoke-ProcessASDatabase -Server $ServerName -DatabaseName $DatabaseN ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (-Redacted-:String) [Invoke-ProcessASDatabase], OperationException + FullyQualifiedErrorId : Microsoft.AnalysisServices.PowerShell.Cmdlets.ProcessASDatabase


Solution

  • This is usually caused by a mismatch in the schema in AAS query and the datasource. Have any of the database tables been edited in any way? If so, that is the most likely culprit.

    Invoke-ProcessTable and Invoke-ProcessPartition can be used to process individual parts of the model that you suspect to be an issue.