<span style="color:#000000;"><span style="color:#000000;"><span style="color:#000000;">Alter database [MyDatebase]
Add file
(NAME = epdata3,
FILENAME=
'D:\SQL_File\epdata3.ndf',
SIZE = 30MB ,
MAXSIZE= UNLIMITED,
FILEGROWTH = 10%) </span></span></span>
<span style="color:#000000;"><span style="color:#000000;"><span style="color:#000000;">Alter database [MyDatebase]
Add LOG file
( NAME = eplog1,
FILENAME = 'D:\SQL_File\eplog1.ldf',
SIZE = 30MB,
MAXSIZE = 50MB,
FILEGROWTH = 10MB )</span></span></span>
<span style="color:#000000;"><span style="color:#000000;">ALTER DATABASE [MyDatebase]
remove file eplog1 </span></span>
更改一张表的基本格式:
alter table table_name
add col_nametype[null|identity]
[,col_nametype [null|identity]…]
drop column col_name [{,col_name}…]
alter column col_name type{null|identity}
[{,col_nametypenull|identity}…]
增加列:
alter table employee
add telephone_no char(12) null
删除列:
alter table employee
drop column telephone_no
格式:alter table table_name
[with check|nocheck]
add col_name type [{null|identity}]
[{,col_name type null|identity}…]
drop column col_name[{,col_name}…]
alter column col_nametype {null|indentity}
[{,col_name type null|identity}…]
add table_constraint
drop table_constraint