Share via


NotificationComputedField Class

Represents a computed field in a notification class schema.

Spazio dei nomi: Microsoft.SqlServer.Management.Nmo
Assembly : Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Sintassi

'Dichiarazione
Public NotInheritable Class NotificationComputedField
    Inherits NamedSmoObject
public sealed class NotificationComputedField : NamedSmoObject
public ref class NotificationComputedField sealed : public NamedSmoObject
public final class NotificationComputedField extends NamedSmoObject
public final class NotificationComputedField extends NamedSmoObject

Osservazioni

Computed fields allow you to make use of the calculation facilities of Microsoft SQL Server. Using computed fields can improve the performance of your notification application, can reduce the work that you must do in the content formatter, and enables you to use the rich formatting and conversion capabilities in Transact-SQL.

Computed fields are never stored in the notifications table. Instead, they are computed immediately before the notification data is passed to the content formatter.

If you add or delete a computed field, updating the application deletes and re-creates the notification class to which it corresponds. This includes dropping and re-creating the database tables used by this notification class. Make sure to back up your application database before updating the application.

Inheritance Hierarchy

System.Object
   Microsoft.SqlServer.Management.Smo.SmoObjectBase
     Microsoft.SqlServer.Management.Smo.SqlSmoObject
       Microsoft.SqlServer.Management.Smo.NamedSmoObject
        Microsoft.SqlServer.Management.Nmo.NotificationComputedField

Esempio

The following example shows how to define a computed field for a notification class:

NotificationComputedField computedPrice = 
    new NotificationComputedField(flightNotifications, 
    "FormattedPrice");
computedPrice.SqlExpression = "CONVERT(NVARCHAR(10), Price, 1)";
flightNotifications.NotificationComputedFields.Add(computedPrice);
Dim computedPrice As NotificationComputedField = _
    New NotificationComputedField(flightNotifications, _
    "FormattedPrice")
computedPrice.SqlExpression = "CONVERT(NVARCHAR(10), Price, 1)"
flightNotifications.NotificationComputedFields.Add( _
    computedPrice)

Thread Safety

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.

Piattaforme

Piattaforme di sviluppo

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Piattaforme di destinazione

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Vedere anche

Riferimento

NotificationComputedField Members
Microsoft.SqlServer.Management.Nmo Namespace

Altre risorse

Definizione dello schema delle notifiche
ComputedField Element (ADF)