创建数据库:
create database student
on primary
(
name='student_data',
filename='d:student_data.mdf',
size=100mb,
maxsize=100mb,
filegrowth=15%
)
log on
(
name='student_log',
filename='d:student_log.ldf',
size=2mb,
filegrowth=1mb
)
删除数据库
use master
go
if exists(select * from sysdatabases where name='student')
drop database student
go
删除数据库
use master
go
if exists(select * from sysdatabases where name='student')
drop database student
go
创建表
use student(databasename)
go
create table stumark
(
ExamNO int identity(1,1) primary key,
stuNo char(6) not null,
writtenExam int not null,
LabExam int not null
)