Compartir a través de


Chronicles Element for SubscriptionClass (ADF)

Provides a location for defining one or more Transact-SQL statements that determine the table structure for the chronicle tables used by the subscription class.

Sintaxis

<SubscriptionClasses>
    <SubscriptionClass>
        ...
        <Chronicles>

Element Characteristics

Characteristic Description

Data type

None.

Default value

None.

Occurrence

Optional once per SubscriptionClass element.

Updates

Can be added and deleted when updating an application.

Element Relationships

Relationship Elements

Parent element

SubscriptionClass Element (ADF)

Child elements

Chronicle Element for SubscriptionClass/Chronicles (ADF)

Notas

If you update the ChronicleName value, updating the application re-creates the subscription class to which it corresponds. Microsoft SQL Server 2005 Notification Services renames existing subscription tables by appending "Old" to the name and then creates new subscription tables. Existing subscription table indexes remain unchanged.

If you want to copy data between the old and new subscription tables, you must do so after updating the application. For more information, see Actualizar una aplicación.

Ejemplo

The following example shows a Chronicles element that deletes any existing table named StockSubsriptionChron and then creates a StockSubscriptionChron subscription chronicle table. This table consists of the SubscriberID, StockSymbol, and StockPrice fields.

<Chronicles>
    <Chronicle>
        <ChronicleName>StockSubscriptionChron</ChronicleName>
        <SqlSchema>
            <SqlStatement>
            -- Delete any existing table with the same name.
            IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES 
            WHERE TABLE_NAME = &apos;StockSubscriptionChron&apos;)
            DROP TABLE StockSubscriptionChron
            </SqlStatement>
            <SqlStatement>
            -- Create subscription chronicle
            CREATE TABLE StockSubscriptionChron
            (
            SubscriberId bigint,
            StockSymbol char(10),
            StockPrice money
            PRIMARY KEY (SubscriberId)
            );
            </SqlStatement>
        </SqlSchema>
    </Chronicle>
</Chronicles>

Vea también

Referencia

Application Definition File Reference

Otros recursos

Definir crónicas para una clase de suscripción
Actualizar instancias y aplicaciones

Ayuda e información

Obtener ayuda sobre SQL Server 2005