Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Dropping an Index

There will be times when an index is redundant and should be removed (i.e., dropped) from a table. Dropping an index is simply a case of executing the DROP INDEX statement, followed by the table name and the index name. Keep in mind that for every index that exists, processing time is required to keep that index up to date for every data modification. Therefore, when you create a new index that uses the same columns as an existing index, you should drop the old one; or when an index is no longer providing speedy data access and is therefore being ignored by SQL Server, it should be dropped.

images Note If the index is used by a primary key or unique constraint, you cannot drop it directly. In this case, you must use the DROP CONSTRAINT command. The removal of this constraint will also remove the index from the table.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint