A table contains columns and indexes. Besides, a table has options such as table type, row format and so on. Defining a table structure means setting up all these elements.
To define table structure, create a table or open existing one from Database Explorer. There are five tabs in Table Editor: Main, Constraints, Indexes, Storage, and Data.
Switch to the Columns tab of Table Editor to define columns or rename the table.
To add a column to table, right-click the grid, and then click New Column on the shortcut menu. Alternatively, press the INSERT key.
To edit an existing column and its properties, double-click a column row.
To remove a column, right-click on it and select Delete Column from shortcut menu.
Switch to the Constraints tab of Table Editor to add or alter foreign and primary keys.
To add a key to table, right-click the tab, and then click New Foreign Key or New Primary Key on the shortcut menu, then choose the type of key you want to create.
To edit an existing key, right-click it, and then click Edit Constraint on the shortcut menu. You can also double-click on a key row to accomplish this task.
To remove a key, right-click it and select Delete Constraint from shortcut menu.
Switch to the Indexes tab of Table Editor to define indexes. Generally, it is similar to defining columns.
To add an index to table, right-click on the tab and choose New Index from shortcut menu. Another way to do it is to press the INSERT key.
To edit an existing index and its properties, double-click an index row to accomplish this task.
To remove an index, right-click it, and then click Delete Index on the shortcut menu.
Download dbForge Studio for SQL Server and try it absolutely free for 30 days!