Display 4.12 Foreign Key Column Selected
6. Click OK to save the selected columns in the metadata for the foreign key. The new
key is displayed in the Details pane.
7. Click OK to save the key.
Update the Columns in a Key
To add, delete, or change the order of columns in a primary key or unique key, select the
key in the Keys pane, and then use the controls in the Details pane, such as the Add
button, the up and down arrows, and so on. The only change you can make to a foreign
key in the Details pane is to select a different foreign key column.
Delete or Rename a Key
To delete or rename a key, right-click the key in the Keys pane and select Delete or
Rename.
Note: You cannot delete a primary key or a unique key that has a foreign key
association. Deleting a key that is referenced by a foreign key breaks the table that
contains the foreign key. You must delete the foreign key from the other table before
you are permitted to delete the primary key or unique key in the current table.
Maintaining Indexes
Problem
You want to create a new index for a table, or to modify or delete an existing index.
Solution
Use the Indexes tab on the properties window for the table to perform the following
tasks:
“Create a New Index” on page 110
“Delete an Index or a Column” on page 110
“Rearrange the Columns in an Index” on page 111
Maintaining Indexes 109
Tasks
Create a New Index
Perform the following steps to create a new index in the Indexes tab:
1. Click New. A folder displays in the tree in the Indexes field. This folder represents
an index and has an appropriate default name. The name is selected for editing. You
can rename the index to a more appropriate value by typing over the existing name
and pressing the Enter key.
2. Drag a column name from the Columns field to an index folder in the Indexes field
to add one or more columns to the index.
3. Click OK. The following display depicts a sample index.
Display 4.13 Sample Completed Index
Note: If you add one column to the index, you create a simple index. If you add two or
more columns, you create a composite index. If you want the index to be unique,
select the index name in the Indexes field, and then select the Unique values check
box. Finally, if you are working with a SAS table and want to ensure that the index
contains no missing values, check the No missing values check box.
Delete an Index or a Column
Perform the following steps to delete an index or to delete a column from an index in the
Indexes window or tab:
1. Select the index or column in the tree in the Indexes field.
2. Click the Delete button, or press the Delete key on your keyboard.
3. Click OK.
110 Chapter 4 Working with Tables

Get SAS Data Integration Studio 4.9 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.