Msg 153, Level 15, State 1, Line 6 Invalid usage of the option SIZE in the CREATE/ALTER DATABASE

  • I am brand new to SQL and practicing. Been reading a book by Mike Hotek and this is what I came up with. Thanks for any help.

    SQL 2012 express

    Msg 153, Level 15, State 1, Line 6

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

    Msg 132, Level 15, State 1, Line 28

    The label 'C' has already been declared. Label names must be unique within a query batch or stored procedure.

    Msg 153, Level 15, State 1, Line 7

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

    CREATE DATABASE SQL2008SBS ON PRIMARY

    ( NAME = N'SQL2008SBS', FILENAME = N'C:\Program

    Files\

    Microsoft SQL

    Sever\MSSQL10.MSSQLSERVER\MSSQL\DATA\SQL2008SBS.mdf'

    SIZE = 3MB , MAXSIZE = UNLIMITED, FILEGROWTH =

    10% ),

    FILEGROUP FG1 DEFAULT ( NAME =

    N'SQL2008SBSFG1_Dat1',

    FILENAME = N'C:\Program Files\

    Microsoft SQL

    Sever\MSSQL10.MSSQLSERVER\MSSQL\DATA\SQL2008SBS_1.ndf

    SIZE = 2MB , MAXSIZE = UNLIMITED, FILEGROWTH =

    2MB) ,

    (NAME = N'SQL2008SBSFG1_Dat2',

    FILENAME = N'C:\Program Files\

    Microsoft SQL

    Sever\MSSQL10.MSSQLSERVER\MSSQL\DATA\SQL2008SBS_2.ndf

    SIZE = 2MB , MAXSIZE = UNLIMITED, FILEGROWTH =

    2MB) ,

    (NAME = N'SQL2008SBSFG1_Dat3',

    FILENAME = N'C:\Program Files\

    Microsoft SQL

    Sever\MSSQL10.MSSQLSERVER\MSSQL\DATA\SQL2008SBS_3.ndf

    SIZE = 2MB , MAXSIZE = UNLIMITED, FILEGROWTH =

    2MB) ,

    LOG ON

    ( NAME = N'SQL2008SBS_Log', FILENAME = N'C:\Program

    Files\

    Microsoft SQL

    Sever\MSSQL10.MSSQLSERVER\MSSQL\DATA\SQL2008SBS.1df

    SIZE = 2MB , MAXSIZE = UNLIMITED, FILEGROWTH =

    10MB )

    GO

    CREATE DATABASE SQL2008SBS ON PRIMARY

    ( NAME = N'SQL2008SBS', FILENAME = N'C:\Program

    Files\

    Microsoft SQL

    Sever\MSSQL10.MSSQLSERVER\MSSQL\DATA\SQL2008SBS.mdf'

    SIZE = 3MB , MAXSIZE = UNLIMITED, FILEGROWTH =

    10% ),

    FILEGROUP DocumentFileStreamGroup CONTAINS

    FILESTREAM

    ( NAME N'FileStreamDocuments', FILENAME =

    N'C:\Program Files\

    Mcrosoft SQL

    Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\SQL2008SBS' )

  • You need a comma after the filename before the size. You've also not closed the quotes after the strings in several places (eg FILENAME = N'C:\Program Files\Microsoft SQL Sever\MSSQL10.MSSQLSERVER\MSSQL\DATA\SQL2008SBS_1.ndf SIZE = 2MB, there's no closing ' after the file name)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thank you I will try to fix those errors and execute it again

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

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