在查询分析器中,输入并执行CREATE DATABASE命令,具体如下

(1)数据库名称为Test;

(2)主数据文件:逻辑文件名为Testdat1,物理文件名称为Testdat1.mdf,初始容量为1MB,最大容量为10MB,递增量为1MB;

(3)辅助数据文件:逻辑文件名为Testdat2,物理文件名称为Testdat2.ndf,初始容量为1MB,最大容量为10MB,递增量为1MB;

(4)事务日志文件:逻辑文件名为Testlog1,物理文件名称为Testlog1.ldf,初始容量为512KB,最大容量为5MB,递增量为512KB。

use master
go
if exists(select * from sysdatabases where name='Test')
begin
drop database Test
end
go
create database Test
on
(
name='Test',
filename='D:\学习\项目\News\Testdat1.mdf',
size=1,
maxsize=10,
filegrowth=100%
)
,
( name='Test',
filename='D:\学习\项目\News\Testdat2.ndf',
size=1MB,
maxsize=10MB,
filegrowth=1

log on
(
name='Test',
filename='D:\学习\项目\News\Testlog1.ldf',
size=512KB,
maxsize=5MB,
filegrowth=50%
)
go
use Test
go
if exists(select * from sysobjects where name='T_Login' and type='u')
begin
drop table T_Login
end
go
create table T_Login
(
F_username varchar(10) not null,
F_userpwd varchar(10) not null,
F_userTypeId int not null
)
具体就是这样的,希望能帮到你
温馨提示:答案为网友推荐,仅供参考