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 帮助