共用方式為


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.

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

NotificationComputedField Members
Microsoft.SqlServer.Management.Nmo Namespace

其他資源

定義通知結構描述
ComputedField Element (ADF)