键与 table 中的任何行都不匹配

The key didn't match any rows in the table

我正在尝试使用下面的 PowerShell 命令刷新我的 Azure Analysis Services 模型。

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

问题

我收到一条错误消息,但它不是很有帮助。有谁知道如何找出我的模型的哪一部分坏了?

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

这通常是由于 AAS 查询中的架构与数据源不匹配造成的。是否以任何方式编辑了任何数据库表?如果是这样,那是最有可能的罪魁祸首。

Invoke-ProcessTable and Invoke-ProcessPartition 可用于处理您怀疑有问题的模型的各个部分。