SqlSchema Element for SubscriptionClass/Chronicles/Chronicle (ADF)

Contains the Transact-SQL statements that define a subscription chronicle table.

Syntax

<SubscriptionClasses>
    <SubscriptionClass>
        ...
        <Chronicles>
            <Chronicle>
                ...
                <SqlSchema>

Element Characteristics

Characteristic Description

Data type

None.

Default value

None.

Occurrence

Required once per Chronicle element.

Updates

Cannot be added or deleted.

Element Relationships

Relationship Elements

Parent element

Chronicle Element for SubscriptionClass/Chronicles (ADF)

Child elements

SqlStatement Element for SubscriptionClass/Chronicles/Chronicle/SqlSchema (ADF)

Hinweise

A SqlSchema element defines one or more SqlStatement elements.

When using a subscription chronicle you should include one SqlStatement element that drops or renames the chronicle table if it already exists, and one SqlStatement element that creates the chronicle table. If you do not drop or rename an existing chronicle table, you will receive an "object exists" error when you update the application.

If you want to keep your subscription chronicle data when updating your application, you can comment out the CREATE TABLE statement in your application definition file (ADF) after you create the application.

Beispiel

The following example shows how to drop an existing subscription chronicle table named StockSubscriptionChron, and then create the subscription chronicle table. The table contains three columns, SubscriberID, StockSymbol, and StockPrice.

<SqlSchema>
    <SqlStatement>
    IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES 
    WHERE TABLE_NAME = &apos;StockSubscriptionChron&apos;)
    DROP TABLE StockSubscriptionChron;
    </SqlStatement>
    <SqlStatement>
    CREATE TABLE StockSubscriptionChron
    (
    SubscriberId bigint,
    StockSymbol char(10),
    StockPrice money
    PRIMARY KEY (SubscriberId)
    );
    </SqlStatement>
</SqlSchema>

Siehe auch

Verweis

Application Definition File Reference

Andere Ressourcen

Definieren von Verläufen für eine Abonnementklasse
Aktualisieren von Instanzen und Anwendungen

Hilfe und Informationen

Informationsquellen für SQL Server 2005