Chapter 21Defining Indexes and Primary Keys

Indexes speed the processes of finding and sorting records. You should create indexes for fields that are frequently used in searches and in sorting. You can create an index on a new or existing table. An index can be made of one or more fields. This chapter presents a number of procedures that use Data Definition Language statements to define indexes and primary keys.

Creating Tables with Indexes

You can create an index while creating a table by using the CONSTRAINT clause with the CREATE TABLE statement. The procedure in Hands-On 21-1 creates a new table called Supplier1 with a unique index called idxSupplierName based on the SupplierName field.

Hands-On 21-1: Creating a Table with a Single-Field ...

Get Access 2007 Programming by Example with VBA, XML, and ASP 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.