MSSQL 2016: Unique table computation failed

Microsoft.SQLServer.2016.Unique_table_computation_failed_1_5_Rule (Rule)

Unique tables are used by the database client drivers, like Microsoft Access driver for SQL Server, to build updateable queries. For a given SELECT statement, the unique table identifies the table whose row values appear at most once in the result set. When reselecting a row from a result set, the values from the key columns of the unique table are enough to identify the row. This error is raised when the server is unable to compute the unique table.

Knowledge Base article:

Summary

Unique tables are used by the database client drivers, like Microsoft Access driver for SQL Server, to build updateable queries. For a given SELECT statement, the unique table identifies the table whose row values appear at most once in the result set. When reselecting a row from a result set, the values from the key columns of the unique table are enough to identify the row. This error is raised when the server is unable to compute the unique table.

Causes

This error may be raised when the SELECT query has a UNION, GROUP BY, ROLL UP or other aggregates. Unique tables are not defined for these cases.

Resolutions

Re-write the query avoiding the constructs which prevent unique table computation. In most of the error scenarios, updateable result set is not implementable.

Overrideable Parameters

Name

Description

Default Value

Enabled

Enables or disables the workflow.

Yes

Priority

Defines Alert Priority.

1

Severity

Defines Alert Severity.

2

Element properties:

TargetMicrosoft.SQLServer.2016.DBEngine
CategoryEventCollection
EnabledTrue
Event_ID16959
Event Source$Target/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.DBEngine"]/ServiceName$
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
RemotableTrue
Alert Message
MSSQL 2016: Unique table computation failed
{0}
Event LogApplication
CommentMom2016ID='{E8827C4D-1683-4BC1-915A-32FB2D21441B}';MOM2016GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}

Member Modules:

ID Module Type TypeId RunAs 
_F6DA1507_12AF_11D3_AB21_00A0C98620CE_ DataSource Microsoft.Windows.EventProvider Default
GenerateAlert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.SQLServer.2016.Unique_table_computation_failed_1_5_Rule" Target="SQL2016Core!Microsoft.SQLServer.2016.DBEngine" Enabled="true" ConfirmDelivery="true" Remotable="true" Comment="Mom2016ID='{E8827C4D-1683-4BC1-915A-32FB2D21441B}';MOM2016GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="_F6DA1507_12AF_11D3_AB21_00A0C98620CE_" Comment="{F6DA1507-12AF-11D3-AB21-00A0C98620CE}" TypeID="Windows!Microsoft.Windows.EventProvider">
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<LogName>Application</LogName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$Target/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.DBEngine"]/ServiceName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>16959</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="SystemHealth!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>2</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.2016.Unique_table_computation_failed_1_5_Rule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>Event ID: $Data/EventDisplayNumber$. $Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>