General form, CREATE
INDEX statement:
CREATE <UNIQUE> INDEX index-name
ON table-name (column-name-1<,
...column-name-n>);
UNIQUE
is a keyword that specifies
that all values of the column(s) specified in the statement must be
unique.
index-name
specifies the name
of the index to be created. If you are creating an index on one column
only, then index-name must
be the same as column-name-1.
If you are creating an index on more than one column, then index-name cannot
be the same as the name of any existing column or index in the table.
table-name
specifies the name
of the table on which the index is created.
column-name
specifies a column
to be indexed. Columns can be specified in any order. However, column
order is important for data retrieval. The first-named column is the
primary key, the second-named column is the secondary key, and so
on.
|
proc sql; create unique index EmpID on work.payrollmaster(empid);
proc sql; create unique index daily on work.marchflights(flightnumber,date);