create database Student --创建数据库Student
--设置两个次要数据库文件,位于默认的文件组中
on primary
(
name='student2',
filename='c:\data\student2.mdf',
size=20MB,
maxsize=100MB,
filegrowth=1MB
),
(
name='student3',
filename='c:\data\student3.mdf',
size=20MB,
maxsize=100MB,
filegrowth=1MB
)
--两个日志文件
log on
(
name='studentlog1',
filename='c:\data\studentlog1.ldf',
size=10MB,
maxsize=50MB,
filegrowth=1MB
),
(
name='studentlog2',
filename='c:\data\studentlog2.ldf',
size=10MB,
maxsize=50MB,
filegrowth=1MB
)
alter database Student
add filegroup MyGroup
alter database Student
--设置主文件,位于设置的文件组中
add file
(
name='student1',
filename='c:\data\student1.ndf',
size=20MB,
maxsize=unlimited,
filegrowth=2MB
)
to filegroup MyGroup
T-SQL语句实现数据库的创建于初始化
最新推荐文章于 2022-05-06 14:04:15 发布