question

BaMiniCo avatar image
BaMiniCo asked

Msg 156, Level 15, State 1, Line 2 Incorrect syntax near the keyword 'ON'.

CREATE DATABASE BANK ON PRIMARY ( NAME = 'BANK_DATABASE', FILENAME = 'E:\sql\BANK_DATABASE_FILE.mdf', SIZE = 5MB, MAXSIZE = 100MB, FILEGROWTH = 10MB ), FILEGROUP REF_BRANCH_TYPES ( NAME = 'REF_BRANCH_TYPES_FILE', FILENAME = 'E:\sql\REF_BRANCH_TYPES_DATAFILE.ndf', SIZE = 5MB, MAXSIZE = 100MB, FILEGROWTH = 10MB ), FILEGROUP ADDRESSES ( NAME = 'ADDRESS_FILE', FILENAME = 'E:\sql\ADDRESS_DATAFILE.ndf', SIZE = 5MB, MAXSIZE = 100MB, FILEGROWTH = 10MB ), FILEGROUP BRANCHES ( NAME = 'BRANCH_FILE', FILENAME = 'E:\sql\BRANCH_DATAFILE.ndf', SIZE = 5MB, MAXSIZE = 100MB, FILEGROWTH = 10MB ), LOG ON ( NAME = 'BANK_DATABASE_LOG',FILENAME = 'E:\PROD_SALES_DATABASE_LOG.ldf' ) Error: Msg 156, Level 15, State 1, Line 2 Incorrect syntax near the keyword 'ON'. Every time I try this code no matter what I do, I get the same error.
tsqlsql server
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JohnM avatar image JohnM commented ·
Try removing the comma before the 'LOG ON' statement. Then it should compile. It did for me on SQL 2014.
1 Like 1 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.