Size error when creating database

  • I am trying to run the script below and keep receiving an error message.

    "Invalid usage of the option SIZE in the CREATE/ALTER DATABASE statement"

    This is from the Microsoft book MCTS: 70-431. Any help is greatly appreciated.

    CREATE DATABASE Projects

    ON

    PRIMARY

    (NAME = ProjectPrimary,

    FILENAME = 'C:\Projects_Data\ProjectPrimary.mdf'

    SIZE = 100MB,

    MAXSIZE = 200,

    FILEGROWTH = 20),

    FILEGROUP ProjectsFG

    ( NAME = ProjectData1,

    FILENAME = 'C:\Projects_Data\ProjectData1.ndf'

    SIZE = 200MB,

    MAXSIZE = 1200,

    FILEGROWTH = 100),

    ( NAME = ProjectData2,

    FILENAME = 'C:\Projects_Data\ProjectData2.ndf'

    SIZE = 200MB,

    MAXSIZE = 1200,

    FILEGROWTH = 100),

    FILEGROUP ProjectsHistoryFG

    ( NAME = ProjectHistory1,

    FILENAME = 'C:\Projects_Data\ProjectHistory.ndf'

    SIZE = 100MB,

    MAXSIZE = 500,

    FILEGROWTH = 50)

    LOG ON

    (NAME = Archlog1,

    FILENAME = 'C:\Projects_Data\ProjectLog.ldf'

    SIZE = 300MB,

    MAXSIZE = 800,

    FILEGROWTH = 100)[/size]

  • I am assuming it is related to your index file definition is bigger than your MDF and LDF files which are the data and transaction log files. Check below for Microsoft code sample to create database with same number of files defined.

    http://msdn.microsoft.com/en-us/library/ms179316.aspx

    Kind regards,
    Gift Peddie

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply