SQL数据库语句

 

on xxx --主文件

name=‘xxxx’,

fliename='里面写文件放的路径\xxxx.mdf',

size=xxMB,

filegrowth=xxMB,

maxsize=xxMB

)

log on

(

name='xxxx_log',

filename='里面存放的路径\xxxx_log.idf',

size=xMB,

filegrowth=xx%

)

use MySchool

create table Class

(

sid int identity(1,1)primary key,

sname narchar(16) not null,

sDesciootion nvarchar(512),

)

--设置可以插入自动增长的主键 一般我们不去做这个

set IDENTITY_INSERT Class off

--向已知的表中添加新列

alter table Class add sCount int not null

--向表中删除列

alter table Class drop column sCount

--移除表中的数据不会还原自动增加的列 不会删除表

delete from Class where cid=3

--把表直接删除

drop table Class

--删除 会还原自动曾长的列

truncate table Class

 

posted @ 2015-06-25 22:56  花神华安  阅读(179)  评论(0编辑  收藏  举报