Partager via


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.

Syntaxe

<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)

Notes

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 Mise à jour d'une application.

Exemple

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>

Voir aussi

Référence

Application Definition File Reference

Autres ressources

Définition de chroniques pour une classe d'abonnement
Mise à jour des instances et des applications

Aide et Informations

Assistance sur SQL Server 2005