A table type is a user-defined data type that defines a table structure, including columns and data types. You can use table types to pass multiple rows of data to stored procedures and functions.
In Database Explorer, you can perform operations on table types using the shortcut menu. Right-click a table type to access commands for specific tasks, such as duplicating table types or generating scripts for them.
You can create a table type in SQL Editor using:
1. Right-click the required table type and select Duplicate Object.
2. In the Duplicate Object dialog, configure the object settings:
3. Click OK.
1. Right-click the table type you want to delete and select Delete.
Alternatively, press Delete.
2. Click Yes to confirm the deletion.
Note
You cannot undo the drop operation. Back up the database before you delete the table type from the database.
1. Right-click the required table type, select Generate Script As, then select the statement type.
2. Select one of the following options:
For more information, see Generate the DDL and DML statements for database objects.
To view properties of a table type, right-click the table type or Table Types node and select Show Details.
Object Viewer opens and provides detailed information about the table type.
To update the table type to reflect the latest changes, right-click the table type or Table Types node and select Refresh.
Alternatively, press F5.
To open the Properties pane, right-click the table type and select Properties.
Alternatively, press F4.
1. Right-click the Table Types node and select Filter.
2. In the Filter Settings dialog, configure the filter parameters.
3. Click OK.
Note
When you open the Table Types node, the number of objects it contains appears in parentheses next to the node name. This number changes based on your filter settings.
The following table describes the shortcut menu options available for a table type in Database Explorer.
| Name | Description |
|---|---|
| Source Control > Source Control Manager | Opens Source Control Manager, where you can track and manage changes to database schema and static data. When Source Control Manager is already open, this option refreshes it. |
| Source Control > Commit | Opens Source Control Manager with all local changes (if any) selected and ready to commit. When Source Control Manager is already open, this option refreshes it and selects all local database changes. |
| Source Control > Get Latest | Opens Source Control Manager with all remote changes (if any) selected and ready to retrieve using Get Latest. When Source Control Manager is already open, this option refreshes it and selects all remote database changes. |
| Duplicate Object | Opens the Duplicate Object dialog to duplicate the table type. |
| Generate Script As | Generates a script for the selected object using the CREATE, DROP, and DROP and CREATE statements. The script can be saved to a new SQL document or to a file, or copied to the clipboard. |
| Show Details | Opens Object Viewer that displays object details. |
| Delete | Drops the selected table type from the database. Shortcut: Delete |
| Refresh | Updates the object to reflect the latest changes. Shortcut: F5 |
| Properties | Opens the Properties pane that displays the object information. Shortcut: F4 |
The following table describes the shortcut menu options available for the Table Types node in Database Explorer.
| Name | Description |
|---|---|
| Source Control > Source Control Manager | Opens Source Control Manager, where you can track and manage changes to database schema and static data. When Source Control Manager is already open, this option refreshes it. |
| Source Control > Commit | Opens Source Control Manager with all local changes (if any) selected and ready to commit. When Source Control Manager is already open, this option refreshes it and selects all local database changes. |
| Source Control > Get Latest | Opens Source Control Manager with all remote changes (if any) selected and ready to retrieve using Get Latest. When Source Control Manager is already open, this option refreshes it and selects all remote database changes. |
| Filter | Opens the Filter Settings dialog to control which table types should appear in Database Explorer. |
| Show Details | Opens Object Viewer that displays object details. |
| Refresh | Updates the object to reflect the latest changes. Shortcut: F5 |
Note
The Source Control shortcut menu is available only after you link the corresponding database to a source control system.
In Database Explorer, hold down Ctrl and select table types. Then right-click the selection and select the required option.
The following table describes the shortcut menu options available for multiple table types.
| Name | Description |
|---|---|
| Source Control > Source Control Manager | Opens Source Control Manager, where you can track and manage changes to database schema and static data. When Source Control Manager is already open, this option refreshes it. |
| Source Control > Commit | Opens Source Control Manager with all local changes (if any) selected and ready to commit. When Source Control Manager is already open, this option refreshes it and selects all local database changes. |
| Source Control > Get Latest | Opens Source Control Manager with all remote changes (if any) selected and ready to retrieve using Get Latest. When Source Control Manager is already open, this option refreshes it and selects all remote database changes. |
| Source Control > Link/Unlink Static Data | Opens the Source Control Link Static Data dialog that displays the tables whose data you want to link. |
| Generate Script As | Generates scripts of the selected objects using the CREATE, DROP, and DROP and CREATE statements. The scripts can be generated to a new SQL document or to a file, or copied to the clipboard. |
| Delete | Drops the selected table types from the database. Shortcut: Delete |
