IBM Database Add-Ins for Visual Studio  

Creating Tables

The IBM® Database Add-Ins for Visual Studio simplify the process of creating tables. You can use one of the following tools to create an IBM database table:

With the designer, you provide information about the table, create columns for the table, define a primary key, unique keys, and foreign keys, and specify script options for the table. With the designer, you also can create indexes and specify triggers, check constraints, and access privileges for the table.

To create a table by using the designer:

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

    The IBM Table Designer opens.

  2. Use the views in the designer to define the columns, keys, indexes, check constraints, triggers, and access privileges for your table.

    For detailed information about the fields in the designer views, see IBM Table Designer.

  3. Save the table definition. From the File menu, select Save [table name].

    The table definition script is run against the database and the table is created.

  4. Close the designer.

For a DB2 database For an IDS database To create a table by using the editor:

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

    The Add New Item window opens.

  2. In the Categories list, select the Tables folder.
  3. In the Templates list, select Table Script.
  4. In the Name field, type a name for the new table file, and then click Add.

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

  5. Use the editor to make changes to the table.
  6. To save your changes, perform one of the following actions:
    • To save the table with its default file name, from the File menu, select Save [file name].
    • To save the table with another name, from the File menu, select Save [file name] As, type a new name for the table file in the Save File As window, and then click Save.

See Also

Developing IBM Database Tables | IBM Database Tables | Managing Procedures, Functions, and Objects


.NET Development Forum   developerWorks: Visual Studio .NET   DB2 FAQs   IDS FAQs

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