How to define table structure

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.

Define columns

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.

Defining Columns

Define constraints

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.

Defining Constraints

Define indexes

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.

Defining Indexes

Download dbForge Studio for SQL Server and try it absolutely free for 30 days!

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the Studio in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Studio for your business, request a demo to see it in action.
Ready to start using dbForge Studio for SQL Server?