使用SQL语句创建一个数据库,名字为mydb,数据文件名为: mydb_data.mdf(主要文件),初始大小为2MB。事务日
3个回答
展开全部
CREATE DATABASE database_name
[ ON
[ < filespec > [ ,...n ] ]
[ , < filegroup > [ ,...n ] ]
]
[ LOG ON { < filespec > [ ,...n ] } ]
[ COLLATE collation_name ]
[ FOR LOAD | FOR ATTACH ]
< filespec > ::=
[ PRIMARY ]
( [ NAME = logical_file_name , ]
FILENAME = 'os_file_name'
[ , SIZE = size ]
[ , MAXSIZE = { max_size | UNLIMITED } ]
[ , FILEGROWTH = growth_increment ] ) [ ,...n ]
< filegroup > ::=
FILEGROUP filegroup_name < filespec > [ ,...n ]
eg.
USE master
GO
CREATE DATABASE Mydb
ON
( NAME = Mydb_dat,
FILENAME = 'mydb_data.mdf',
SIZE = 2,
MAXSIZE = 50,
FILEGROWTH = 5 )
LOG ON
( NAME = 'Sales_log',
FILENAME = 'mydblog.ldf',
SIZE = 1MB,
MAXSIZE = 25MB,
FILEGROWTH = 1MB )
GO
[ ON
[ < filespec > [ ,...n ] ]
[ , < filegroup > [ ,...n ] ]
]
[ LOG ON { < filespec > [ ,...n ] } ]
[ COLLATE collation_name ]
[ FOR LOAD | FOR ATTACH ]
< filespec > ::=
[ PRIMARY ]
( [ NAME = logical_file_name , ]
FILENAME = 'os_file_name'
[ , SIZE = size ]
[ , MAXSIZE = { max_size | UNLIMITED } ]
[ , FILEGROWTH = growth_increment ] ) [ ,...n ]
< filegroup > ::=
FILEGROUP filegroup_name < filespec > [ ,...n ]
eg.
USE master
GO
CREATE DATABASE Mydb
ON
( NAME = Mydb_dat,
FILENAME = 'mydb_data.mdf',
SIZE = 2,
MAXSIZE = 50,
FILEGROWTH = 5 )
LOG ON
( NAME = 'Sales_log',
FILENAME = 'mydblog.ldf',
SIZE = 1MB,
MAXSIZE = 25MB,
FILEGROWTH = 1MB )
GO
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
create database mydb
on
(
name='mydb_data',
filename='c:\mydb_data.mdf',
size=2mb
)
log on
(
name='mydb_log',
filename='c:\mydb_log.ldf',
size=2mb,
maxsize=5mb,
filegrowth=1mb
)
--上面这些数字根据需要修改
on
(
name='mydb_data',
filename='c:\mydb_data.mdf',
size=2mb
)
log on
(
name='mydb_log',
filename='c:\mydb_log.ldf',
size=2mb,
maxsize=5mb,
filegrowth=1mb
)
--上面这些数字根据需要修改
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
CREATE DATABASE mydb
ON
(NAME='mydb_data',
FILENAME='D:\data\ mydb_data.mdf',
SIZE=2MB,
FILEGROWTH=10%
)
LOG ON
(NAME='mydb_LOG',
FILENAME='D:\data\'mydb_LOG.LOG',
SIZE=1MB,
FILEGROWTH=10%
)
GO
ON
(NAME='mydb_data',
FILENAME='D:\data\ mydb_data.mdf',
SIZE=2MB,
FILEGROWTH=10%
)
LOG ON
(NAME='mydb_LOG',
FILENAME='D:\data\'mydb_LOG.LOG',
SIZE=1MB,
FILEGROWTH=10%
)
GO
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询