MSSQL 2016: 向表中添加列失败

Microsoft.SQLServer.2016.Failed_to_add_column__to_table__1_5_Rule (Rule)

sp_repladdcolumn 未能将指定的列添加至发布数据库中的表。如果与此错误一起报告了另一个错误,则另一个错误应该指示无法添加该列的原因。如果没有报告其他错误,则问题可能是所有者限定的表不存在,或数据类型不是可以添加至复制的表的数据类型。新列的数据类型必须是标识列、计算列或时间戳列,允许为空或有默认值。有关 sp_repladdcolumn 的详细信息,请参阅联机丛书中的“发布数据库上的架构更改”。

Knowledge Base article:

摘要

sp_repladdcolumn 未能将指定的列添加至发布数据库中的表。如果与此错误一起报告了另一个错误,则另一个错误应该指示无法添加该列的原因。如果没有报告其他错误,则问题可能是所有者限定的表不存在,或数据类型不是可以添加至复制的表的数据类型。新列的数据类型必须是标识列、计算列或时间戳列,允许为空或有默认值。有关 sp_repladdcolumn 的详细信息,请参阅联机丛书中的“发布数据库上的架构更改”。

解决方法

如果与此错误一起发生了其他错误,请先解决该错误。如果没有发生其他错误,则验证指定的表是否存在,并验证表所有者是否有效且是否映射至有效的登录。验证指定的数据类型是否有效。

可替代参数

名称

说明

默认值

已启用

启用或禁用工作流。

优先级

定义警报优先级。

1

严重性

定义警报严重性。

2

Element properties:

TargetMicrosoft.SQLServer.2016.DBEngine
CategoryEventCollection
EnabledTrue
Event_ID21285
Event Source$Target/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.DBEngine"]/ServiceName$
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
RemotableTrue
Alert Message
MSSQL 2016: 向表中添加列失败
{0}
Event LogApplication
CommentMom2016ID='{F3CE64AC-AA75-4E3F-BD6F-FBD7D4FC139F}';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.Failed_to_add_column__to_table__1_5_Rule" Target="SQL2016Core!Microsoft.SQLServer.2016.DBEngine" Enabled="true" ConfirmDelivery="true" Remotable="true" Comment="Mom2016ID='{F3CE64AC-AA75-4E3F-BD6F-FBD7D4FC139F}';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>21285</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.Failed_to_add_column__to_table__1_5_Rule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>Event ID: $Data/EventDisplayNumber$. $Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>