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:
The IBM Table Designer, with which you can generate a
table and save it to an IBM database that has a data
connection in the Server Explorer.
The Visual Studio Code Editor, with which you can manually
insert the SQL statement in the table script file in an IBM
database project in the Solution Explorer.
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:
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.
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.
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.
Close the designer.
To create a table by using the editor:
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.
In the Categories list, select the Tables folder.
In the Templates list, select Table Script.
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.
Use the editor to make changes to the table.
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.