MSSQL: Update or create and override, alerting on error

Microsoft.SQLServer.Windows.WriteAction.WriteOverrideWithAlert (WriteActionModuleType)

This action creates or updates an override for every incoming data item and generates alert in case of insufficient assess rights.

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityInternal
RunAsMicrosoft.SQLServer.Core.RunAs.SDK
InputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
GenerateAlert WriteAction System.Health.GenerateAlert Default
WA1 WriteAction Microsoft.SQLServer.Windows.WriteAction.WriteOverride Default

Source Code:

<WriteActionModuleType ID="Microsoft.SQLServer.Windows.WriteAction.WriteOverrideWithAlert" Accessibility="Internal" Batching="false" RunAs="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.SDK">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ManagementGroupName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TargetElementId" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TargetModuleName" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TargetParameterName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="OverrideCategory" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="OverrideValue" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="OverrideManagementPackName" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="OverrideManagementPackDisplayName" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="OverrideName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="OverrideDisplayName" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Publisher" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ManagementServerName" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Enforced" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="AlertMessage" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="AlertPriority" type="xsd:integer" minOccurs="1" maxOccurs="1"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="AlertSeverity" type="xsd:integer" minOccurs="1" maxOccurs="1"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="AlertMessageId" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</Configuration>
<OverrideableParameters/>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<WriteAction ID="WA1" TypeID="Microsoft.SQLServer.Windows.WriteAction.WriteOverride">
<ManagementGroupName>$Config/ManagementGroupName$</ManagementGroupName>
<TargetElementId>$Config/TargetElementId$</TargetElementId>
<TargetModuleName>$Config/TargetModuleName$</TargetModuleName>
<TargetParameterName>$Config/TargetParameterName$</TargetParameterName>
<OverrideCategory>$Config/OverrideCategory$</OverrideCategory>
<OverrideValue>$Config/OverrideValue$</OverrideValue>
<OverrideName>$Config/OverrideName$</OverrideName>
<OverrideDisplayName>$Config/OverrideDisplayName$</OverrideDisplayName>
<Publisher>$Config/Publisher$</Publisher>
</WriteAction>
<WriteAction ID="GenerateAlert" TypeID="Health!System.Health.GenerateAlert">
<Priority>$Config/AlertPriority$</Priority>
<Severity>$Config/AlertSeverity$</Severity>
<AlertMessageId>$Config/AlertMessageId$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Config/AlertMessage$</AlertParameter1>
<AlertParameter2>$Data/Property[@Name='ExceptionMessage']$</AlertParameter2>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="GenerateAlert">
<Node ID="WA1"/>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<InputType>System!System.PropertyBagData</InputType>
</WriteActionModuleType>