IBM Database Add-Ins for Visual Studio  

Creating Relational Indexes

The IBM® Database Add-Ins for Visual Studio simplify the process of creating IBM database relational indexes. You can use one of the following tools to create a relational index:

With the wizard and the designer, you provide information about the index, specify the columns that you want to define as part of the index, and specify script options for the index.

To create a relational index by using the designer:

  1. Start creating a table or changing a table definition by using the IBM Table Designer.
  2. From the IBM Table Designer menu, select Indexes.

    The Indexes view of the IBM Table Designer is displayed.

  3. Add an index and define its properties and columns.

    For detailed information about fields in the Indexes view, see Indexes, Designer.

  4. Continue creating the table or changing the table definition.

For a DB2 database To create a relational index by using the wizard (from the Server Explorer):

  1. In the Server Explorer, right-click Tables under your data connection, and then select Add Index with Wizard on the shortcut menu.

    The DB2 Create Index Wizard opens.

  2. Complete the necessary steps of the wizard.

    For detailed information about fields in the wizard, see DB2 Create Index Wizard.

  3. Click Finish.

    Based on the options that you select on the Project Selection page in the wizard:

    • The script is created and stored in an IBM database project.
    • The script is run against the database and the index is created for the table that you specified.

For a DB2 database To create a relational index by using the wizard (from the Solution Explorer):

  1. In the Solution Explorer, right-click the Indexes folder under your IBM database project, select Add on the shortcut menu, and then select New Item.

    The Add New Item window opens.

  2. In the Categories list, select Indexes.
  3. In the Templates list, select Index Wizard.
  4. In the Name field, type a name for the new index file, and then click Add.

    The DB2 Create Index Wizard opens.

  5. Complete the necessary steps of the wizard.

    For detailed information about fields in the wizard, see DB2 Create Index Wizard.

  6. Click Finish.

    The script file is created and added to your project.

To create a relational index by using the editor:

  1. In the Solution Explorer, right-click the Indexes folder under your IBM database project, select Add on the shortcut menu, and then select New Item.

    The Add New Item window opens.

  2. In the Categories list, select Indexes.
  3. In the Templates list, select Index Script.
  4. In the Name field, type a name for the new index file, and then click Add.

    A new index file with a basic structure is created and added to your project.

  5. Use the editor to make changes to the index.
  6. To save your changes, select File, and then select Save [file name].

See Also

Developing IBM Database Indexes | IBM Database Relational Indexes | Creating Tables | Changing Table Definitions | Creating DB2 XML Indexes | Managing Procedures, Functions, and Objects


.NET Development Forum   DB2 FAQs   IDS FAQs

© Copyright IBM Corporation 2002, 2019. All Rights Reserved.