Поделиться через


NotificationComputedField Class

Represents a computed field in a notification class schema.

Пространство имен: Microsoft.SqlServer.Management.Nmo
Сборка: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Синтаксис

'Декларация
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

Замечания

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

Пример

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)

Синхронизация потоков

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.

Платформы

Платформы разработки

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

Целевые платформы

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

См. также

Справочник

NotificationComputedField Members
Microsoft.SqlServer.Management.Nmo Namespace

Другие ресурсы

Определение схемы уведомления
ComputedField Element (ADF)