ComputedField Element (ADF)

Provides a location for defining a computed notification class field.

Sintaxis

<NotificationClasses>
    <NotificationClass>
        ...
        <Schema>
            ...
            <ComputedFields>
                <ComputedField>

Element Characteristics

Characteristic Description

Data type

None.

Default value

None.

Occurrence

Required once or more per ComputedFields element.

Updates

Can be added and deleted when updating the application.

Element Relationships

Relationship Elements

Parent element

ComputedFields Element (ADF)

Child elements

FieldName Element for NotificationClass/Schema/ComputedFields/ComputedField (ADF)

SqlExpression Element for ComputedField (ADF)

DigestGrouping Element for ComputedField (ADF)

Notas

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

Computed fields allow you to make use of the calculation facilities of Microsoft SQL Server. Use of 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.

ms145901.note(es-es,SQL.90).gifImportante:
If you add or delete a ComputedField element, updating the application deletes and re-creates the notification class to which it corresponds. This includes dropping and re-creating the SQL Server tables used by this notification class. Make sure to back up your application database before updating the application.

Ejemplo

The following example shows a populated ComputedField element. The computed field converts the stock price into a formatted string.

<ComputedField>
    <FieldName>FormattedStockPrice</FieldName>
    <SqlExpression>CONVERT(NVARCHAR(10), StockPrice, 1)
    </SqlExpression>
</ComputedField>

Vea también

Referencia

Application Definition File Reference

Otros recursos

CAST y CONVERT (Transact-SQL)
Definir el esquema de notificación
Actualizar instancias y aplicaciones

Ayuda e información

Obtener ayuda sobre SQL Server 2005