Collections:
DROP INDEX - Removing Existing Indexes in SQL Server
How To Drop Existing Indexes in SQL Server?
✍: FYIcenter.com
For some reason, if you want remove an existing index, you can use the DROP INDEX statement with following syntax:
CREATE INDEX table_name.index_name
The tutorial exercise below shows you how to remove the index "fyi_links_id":
USE FyiCenterData; GO SELECT * FROM sys.indexes WHERE object_id = ( SELECT object_id FROM sys.tables WHERE name = 'fyi_links' ); GO object_id name index_id type_desc is_unique --------- ------------- -------- ---------- --------- 421576540 NULL 0 HEAP 0 421576540 fyi_links_id 2 NONCLUSTERED 0 421576540 fyi_links_url 3 NONCLUSTERED 0 DROP INDEX fyi_links.fyi_links_id; GO SELECT * FROM sys.indexes WHERE object_id = ( SELECT object_id FROM sys.tables WHERE name = 'fyi_links' ); GO object_id name index_id type_desc is_unique --------- ------------- -------- ---------- --------- 421576540 NULL 0 HEAP 0 421576540 fyi_links_url 3 NONCLUSTERED 0
2016-11-15, 706👍, 0💬
Popular Posts:
How To Change the Name of a Database User in SQL Server? If you want to change the name of an existi...
How To Create a Table in a Specific Tablespace in Oracle? After you have created a new tablespace, y...
How To Create an Multi-Statement Table-Valued Function in SQL Server Transact-SQL? To create a multi...
How To Import One Table Back from a Dump File in Oracle? If you only want to import one table back t...
Is SQL Server Transact-SQL case sensitive? No. Transact-SQL is not case sensitive. Like the standard...