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

重来没有接触过,零基础学习软件编程,一个字累
原文地址:https://www.cnblogs.com/hsha/p/4601169.html