How to Create Indexes

To create an index on a table, you have to select on which columns to build the index, and then use the CREATE INDEX statement. As an example, to create the index called ndx_Customers_City on the City field of the Customers table, you must execute the statement of Listing 6.9.

Code Listing 6.9. Creating an Index Is Easy Using the CREATE INDEX Statement
					
USE Northwind
GO

CREATE INDEX ndx_Customers_City
ON Customers(City)

You can use Enterprise Manager to create indexes on tables using the Manage Indexes form. To open the Manage Indexes form, you must display the list of tables in a database, select the table in which you ...

Get Microsoft® SQL Server™ 2000 Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.