修改表名的sql语句是“alter table”语句。基本语法是:“alter table a26d98d33123a70024fa8ba5642906c6 [修改选项]”;“alter table”语句用于修改已经存在的表的设计;可以在已有的表中添加、修改或删除列。
修改表名的sql语句是“alter table”语句。
alter table 语句用于在已有的表中添加、修改或删除列。alter语句 在修改sql server表结构时,常用到alter语句,把一些常用的alter语句列举如下
alter table语句用于修改已经存在的表的设计。
基本语法:alter table a26d98d33123a70024fa8ba5642906c6 [修改选项]
alter table table add column field type[(size)] [not null] [constraint index]
alter table table add constraint multifieldindex
alter table table drop column field
alter table table drop constraint indexname
说明:
table参数用于指定要修改的表的名称。
add column为sql的保留字,使用它将向表中添加字段。
add constraint为sql的保留字,使用它将向表中添加索引。
drop column为sql的保留字,使用它将向表中删除字段。
drop constraint为sql的保留字,使用它将向表中删除索引。
field指定要添加或删除的字段的名称。
type参数指定新建字段的数据类型。
size参数用于指定文本或二进制字段的长度。
indexname参数指定要删除的多重字段索引的名称。
推荐教程:《sql视频教程》
以上就是修改表名的sql语句是什么?的详细内容。
