Incorrect Syntax near 'MAXSIZE'

  • I am getting a syntax error when trying to create a database. Here is my code:

    Create database ToddTestDB On Primary

    ( Name = N'ToddTestDB',

    FILENAME = N'C:\Program Files\Microsoft SQL

    Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\

    ToddTestDB.MDF' , Size = 3072KB

    MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )

    LOG ON

    ( NAME = N'ToddTestDB_log',

    FILENAME = N'C:\Program Files\Microsoft SQL

    Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\

    ToddTestDB_log.ldf' ,

    SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%

    COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS

    GO

    Everything looks fine to me but it says:

    Msg 102, Level 15, State 1, Line 6

    Incorrect syntax near 'MAXSIZE'.

  • missing comma I think, try this:

    Create database ToddTestDB On Primary

    ( Name = N'ToddTestDB',

    FILENAME = N'C:\Program Files\Microsoft SQL

    Server\MSSQL10.MSSQLSERVER\MSSQL\DATAToddTestDB.MDF' , Size = 3072KB, -- this was missing!

    MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )

    LOG ON

    ( NAME = N'ToddTestDB_log',

    FILENAME = N'C:\Program Files\Microsoft SQL

    Server\MSSQL10.MSSQLSERVER\MSSQL\DATAToddTestDB_log.ldf' ,

    SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%

    COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS

    GO

    ---------------------------------------------------------

    It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
    David Edwards - Media lens[/url]

    Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
    Howard Zinn

  • Missing a comma and also a closing parenthesis on the log:

    changing the layout for readability was what made me see it:

    Create database ToddTestDB On Primary

    ( Name = N'ToddTestDB',

    FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\ToddTestDB.MDF' ,

    Size = 3072KB,

    MAXSIZE = UNLIMITED,

    FILEGROWTH = 1024KB )

    LOG ON

    ( NAME = N'ToddTestDB_log',

    FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\ToddTestDB_log.ldf' ,

    SIZE = 1024KB ,

    MAXSIZE = 2048GB ,

    FILEGROWTH = 10%)

    COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS

    GO

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • ah.... thx

Viewing 4 posts - 1 through 3 (of 3 total)

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