共用方式為


Database Element (ADF)

Contains elements that define the application database.

語法

<Application>
    ...
    <Database>

Element Characteristics

Characteristic Description

Data type

None.

Default value

None.

Occurrence

Optional once per Application element.

Updates

Cannot be added or deleted when updating the application

Element Relationships

Relationship Elements

Parent element

Application Element (ADF)

Child elements

DatabaseName Element (ADF)

SchemaName Element (ADF)

NamedFileGroup Element (ADF)

LogFile Element (ADF)

DefaultFileGroup Element (ADF)

CollationName Element (ADF)

備註

If the Database element and its child elements are not specified, Microsoft SQL Server Notification Services creates an application database using the default settings for the instance of SQL Server.

範例

The following example shows how to specify database settings in an ADF for an application that has two named filegroups, Primary and Secondary, and a log file named StockLog. It uses the Secondary filegroup as its default filegroup, and uses the SQL_Latin1_General_Cp437_BIN collation.

<Database>
    <NamedFileGroup>
        <FileGroupName>Primary</FileGroupName>
        <FileSpec>
            <LogicalName>StockPrimary</LogicalName>
            <FileName>C:\SQLData\StockPrimary.mdf</FileName>
            <Size>2GB</Size>
            <MaxSize>5GB</MaxSize>
            <GrowthIncrement>500MB</GrowthIncrement>
        </FileSpec>
    </NamedFileGroup>
    <NamedFileGroup>
        <FileGroupName>Secondary</FileGroupName>
        <FileSpec>
            <LogicalName>StockSecondary1</LogicalName>
            <FileName>D:\Data\StockSecondary1.ndf</FileName>
            <Size>1000MB</Size>
            <MaxSize>5000MB</MaxSize>
            <GrowthIncrement>25%</GrowthIncrement>
        </FileSpec>
        <FileSpec>
            <LogicalName>StockSecondary2</LogicalName>
            <FileName>D:\Data\StockSecondary2.ndf</FileName>
        </FileSpec>
    </NamedFileGroup>
    <LogFile>
        <LogicalName>StockLog</LogicalName>
        <FileName>E:\Logs\StockLog.ldf</FileName>
    </LogFile>
    <DefaultFileGroup>Secondary</DefaultFileGroup>
    <CollationName>SQL_Latin1_General_Cp437_BIN</CollationName>
</Database>

請參閱

其他資源

定義應用程式資料庫
CREATE DATABASE (Transact-SQL)

說明及資訊

取得 SQL Server 2005 協助