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
⇒ Primary Key - Default Indexes of Tables in SQL Server
⇐ sys.indexes - Viewing Existing Indexes on an Given Table in SQL Server
2016-11-15, 1336🔥, 0💬
Popular Posts:
How To Format Time Zone in +/-hh:mm Format in SQL Server Transact-SQL? From the previous tutorial, y...
How To Convert Numeric Values to Character Strings in MySQL? You can convert numeric values to chara...
How To End a Stored Procedure Properly in SQL Server Transact-SQL? Where the end of the "CREATE PROC...
How To Locate and Take Substrings with CHARINDEX() and SUBSTRING() Functions in SQL Server Transact-...
Where to find answers to frequently asked questions on Conditional Statements and Loops in SQL Serve...