Freigeben über


NotificationComputedField.SqlExpression Property

Gets or sets the Transact-SQL expression that computes the field value.

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

Syntax

'Declaration
Public Property SqlExpression As String
public string SqlExpression { get; set; }
public:
property String^ SqlExpression {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_SqlExpression ()

/** @property */
public void set_SqlExpression (String value)
public function get SqlExpression () : String

public function set SqlExpression (value : String)

Eigenschaftswert

A String, between 0 and 4000 characters in length, that contains the Transact-SQL statement that computes the field value.

Hinweise

The SqlExpression property is required.

A Transact-SQL expression is a combination of identifiers, values, and operators that the Datenbankmodul can evaluate to get a result. You can use any expression that can be part of a SELECT statement. The terms of the expression can be any of the following:

  • Constants.

  • Calls to functions.

  • The notification fields defined in the ADF (but not computed fields).

  • The following built-in notification fields:

    • SubscriberId

    • DeviceName

    • DeviceTypeName

    • DeviceAddress

    • SubscriberLocale

    • DeliveryChannelName

For more information, see Ausdrücke (Datenbankmodul).

If you update the SqlExpression property, updating the application deletes and re-creates the notification class to which it corresponds. This includes dropping and re-creating the Microsoft SQL Server tables used by this notification class. Any data existing in the original SQL Server tables is permanently deleted.

Beispiel

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)

Threadsicherheit

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.

Plattformen

Entwicklungsplattformen

Eine Liste der unterstützten Plattformen finden Sie unterHardware- und Softwareanforderungen für die Installation von SQL Server 2005.

Zielplattforme

Eine Liste der unterstützten Plattformen finden Sie unterHardware- und Softwareanforderungen für die Installation von SQL Server 2005.

Siehe auch

Verweis

NotificationComputedField Class
NotificationComputedField Members
Microsoft.SqlServer.Management.Nmo Namespace

Andere Ressourcen

Definieren des Benachrichtigungsschemas
SqlExpression Element for ComputedField (ADF)