当前位置: 首页 > 网络学院 > 服务端脚本教程 > SQL > SQL Drop

SQL
SQL 介绍
SQL Select
SQL Where 子句
SQL Insert
SQL Update
SQL Delete
SQL 技能测试
SQL Order By
SQL 与 & OR
SQL In
SQL Between
SQL Aliases
SQL Join
SQL Union
SQL Create
SQL Drop
SQL Alter
SQL 函数
SQL Group By
SQL Select Into

SQL Drop


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 856 ::
收藏到网摘: n/a

Drop Index
取消索引

You can delete an existing index in a table with the DROP INDEX statement.
你可以将现有的索引通过DROP INDEX语句进行取消操作。

Syntax for Microsoft SQLJet (and Microsoft Access):
在Microsoft SQLJet (和 Microsoft Access)中的语法是这样的:

DROP INDEX index_name ON table_name

Syntax for MS SQL Server:
MS SQL Server的语法是这样:

DROP INDEX table_name.index_name

Syntax for IBM DB2 and Oracle:
IBM DB2和Oracle的语法为:

DROP INDEX index_name

Syntax for MySQL:
MySql则是这样:

ALTER TABLE table_name DROP INDEX index_name


Delete a Table or Database
删除一张表或是一数据库

To delete a table (the table structure, attributes, and indexes will also be deleted):
删除一张表(表中的数据结构,属性以及索引也会被删除):

DROP TABLE table_name

To delete a database:
要删除一个数据库的话可以这样写:

DROP DATABASE database_name


Truncate a Table
截表

What if we only want to get rid of the data inside a table, and not the table itself? Use the TRUNCATE TABLE command (deletes only the data inside the table):
当我们只想将表内的数据做完成清楚而保留其内部结构的话,可以使用TRUNCATE TABLE命令(仅仅删除表中的数据)

TRUNCATE TABLE table_name

评论 (0) All

登陆 | 还没注册?