网络学院 w3pop社区 网络资源 IT新闻

w3pop.com :: 网络学院 :: 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


作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-28 浏览:3684 :: ::

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