April 2002
Intermediate to advanced
416 pages
11h 50m
English
The DROP INDEX statement removes an index from a table or view. The following script creates an index and then later drops it:
# Create the Social Security number index. CREATE UNIQUE INDEX idx_SSN ON Employees (SSN); # Work with the database for a while. ... # Drop the Social Security number index. DROP INDEX Employees.idx_SSN;
The DROP INDEX statement cannot remove the indexes built by PRIMARY KEY or UNIQUE constraints used when building a table. For example, it cannot remove the index named con_EmpId in the following script:
# Create the Employees table. CREATE TABLE Employees ( EmployeeId NUMERIC CONSTRAINT con_EmpId UNIQUE NOT NULL, FirstName VARCHAR(50), LastName VARCHAR(50), etc. ); # Work with the database for a while. ...
Read now
Unlock full access