为什么这段代码会报错
CREATE DATABASE Xihuan
ON
--PRIMARY
(NAME = Xinhua1,
FILENAME = 'D:Xinhua\Xinhua1.mdf',
SIZE = 3MB,
MAXSIZE = 10MB,--UNLIMITED 不受限制
FILEGROWTH = 15%,
) ,
(NAME = Xinhua2,
FILENAME = 'D:\Xinhua\Xinhua.ndf',
SIZE = 2MB,
MAXSIZE = 15MB,
FILEGROWTH =2MB,
)
LOG ON
(NAME = Xinhua,
FILENAME = 'D:\DATA\Xinhualog.LDF',
SIZE = 500KB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 500KB
)
database
------解决方案--------------------
CREATE DATABASE Xihuan
ON
--PRIMARY
(NAME = Xinhua1,
FILENAME = 'D:\Xinhua\Xinhua1.mdf',
SIZE = 3MB,
MAXSIZE = 10MB,--UNLIMITED 不受限制
FILEGROWTH = 15%
) ,
(NAME = Xinhua2,
FILENAME = 'D:\Xinhua\Xinhua.ndf',
SIZE = 2MB,
MAXSIZE = 15MB,
FILEGROWTH =2MB
)
LOG ON
(NAME = Xinhua,
FILENAME = 'D:\DATA\Xinhualog.LDF',
SIZE = 500KB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 500KB
)
------解决方案--------------------原因:第一个和第二个括号内的最后一项不需要加逗号,就像你create table 最后一个column不需要加逗号。这是SQL一般约定,多数情况有效。