消息156,级别15,状态1,行2关键字“ON”附近的语法不正确

时间:2021-07-30 22:54:01

//this code,what i have and near "ON" i can not see incorrect syntax

//这个代码,我有什么,靠近“ON”我看不到不正确的语法

CREATE DATABASE ShopDB
ON
(
NAME = 'ShopDB',
FILENAME = 'C:\Projects\SQL\ShopDB.mdf',
SIZE = 10MB,
MAXSIZE = 100MB,
FILEGROWTH = 10MB
)
LOG ON
(
NAME = 'LogShopDB',
FILENAME = 'C:\Projects\SQL\ShopDB.ldf',
SIZE = 5MB,
MAXSIZE = 50MB,
FILEGROWTH = 5MB
)

1 个解决方案

#1


0  

Try this

尝试这个

USE [master]
GO

/****** Object:  Database [ShopDB]    Script Date: 7/27/2017 5:42:58 PM ******/
CREATE DATABASE [ShopDB]
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'ShopDB', 
    FILENAME = N'D:\SqlDatabseFiles\ShopDB.mdf' , 
    SIZE = 4096KB , MAXSIZE = UNLIMITED,
    FILEGROWTH = 1024KB 
)
 LOG ON 
(    NAME = N'ShopDB_log', 
     FILENAME = N'D:\SqlDatabseFiles\ShopDB_log.ldf' , 
     SIZE = 1024KB , 
     MAXSIZE = 2048GB ,
     FILEGROWTH = 10%
)
GO

#1


0  

Try this

尝试这个

USE [master]
GO

/****** Object:  Database [ShopDB]    Script Date: 7/27/2017 5:42:58 PM ******/
CREATE DATABASE [ShopDB]
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'ShopDB', 
    FILENAME = N'D:\SqlDatabseFiles\ShopDB.mdf' , 
    SIZE = 4096KB , MAXSIZE = UNLIMITED,
    FILEGROWTH = 1024KB 
)
 LOG ON 
(    NAME = N'ShopDB_log', 
     FILENAME = N'D:\SqlDatabseFiles\ShopDB_log.ldf' , 
     SIZE = 1024KB , 
     MAXSIZE = 2048GB ,
     FILEGROWTH = 10%
)
GO