if exists(select * from sys.sysdatabases where [name] = 'DB_Student')
drop database DB_Student
go
create database DB_Student
on
(
name = DB_Student_mdf,
filename = 'E:\DB_Student_mdf.mdf',
size = 3mb,
maxsize = 100mb,
filegrowth=1mb
)
log on
(
name = DB_Student_ldf,
filename = 'E:\DB_Student_ldf.mdf',
size = 3mb,
maxsize = 100mb,
filegrowth = 1mb
)
use DB_Student
if exists(select * from sys.objects where [name] = 'T_userInfo' )
drop table T_userInfo
go
use DB_Student
create table T_userInfo
(
stuName varchar(20),
stuId varchar(20) primary key,
score float,
sex varchar(4)
)
alter table T_userInfo
add hobby varchar(20)
go
alter table T_userInfo
alter column hobby varchar(25)
go
use DB_Student
exec sp_rename 'T_userInfo.hobby','hobbys'
go
alter table T_userInfo
drop column hobbys
go