Condividi tramite


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.

Sintassi

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

Osservazioni

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 Aggiornamento di un'applicazione.

Esempio

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>

Vedere anche

Riferimento

Application Definition File Reference

Altre risorse

Definizione di cronologie per una classe di sottoscrizione
Aggiornamento di istanze e applicazioni

Guida in linea e informazioni

Assistenza su SQL Server 2005