This documentation is archived and is not being maintained.

NotificationClassProtocol Class

Represents a delivery protocol for a notification class.

Namespace: Microsoft.SqlServer.Management.Nmo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

public sealed class NotificationClassProtocol : NamedSmoObject
public final class NotificationClassProtocol extends NamedSmoObject
public final class NotificationClassProtocol extends NamedSmoObject

Each notification class must define at least one delivery protocol to deliver notifications.

The delivery protocol must be associated with at least one InstanceDeliveryChannel.

The following examples show how to define an SMTP delivery protocol and then add it to a notification class:

// Define an SMTP protocol for notification delivery
NotificationClassProtocol smtpProtocol = 
    new NotificationClassProtocol(flightNotifications, "SMTP");

// Define fields for the SMTP notifications
ProtocolField smtpProtocolField1 = 
    new ProtocolField(smtpProtocol, "Subject");
smtpProtocolField1.SqlExpression = 
    "'Flight notification: '+CONVERT (NVARCHAR(30), GETDATE())";

ProtocolField smtpBodyField = 
    new ProtocolField(smtpProtocol, "BodyFormat");
smtpBodyField.SqlExpression = "'html'";

ProtocolField smtpFromField = 
    new ProtocolField(smtpProtocol, "From");
smtpFromField.SqlExpression = @"''";

ProtocolField smtpPriorityField = 
    new ProtocolField(smtpProtocol, "Priority");
smtpPriorityField.SqlExpression = "'Normal'";

ProtocolField smtpToField = 
    new ProtocolField(smtpProtocol, "To");
smtpToField.SqlExpression = "DeviceAddress";

// Define protocol execution settings
smtpProtocol.FailuresBeforeEventLog = 2;
smtpProtocol.FailureEventLogInterval = new TimeSpan(0, 10, 0);
smtpProtocol.FailuresBeforeAbort = 10;
smtpProtocol.MulticastRecipientLimit = 50;
smtpProtocol.WorkItemTimeout = new TimeSpan(0, 20, 0);

// Add the SMTP protocol to the notification class

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms