A user-defined type is a data type that is defined to the database using a CREATE TYPE statement.
Database Explorer allows you to perform operations on user types using the shortcut menu. Right-click a user type in Database Explorer to access commands for specific tasks, such as generating a script for objects.
You can create a user type in SQL Editor in one of these ways:
1. In Database Explorer, right-click a required user type and select Duplicate Object.
2. In the Duplicate Object dialog, configure the object settings:
3. Click OK.
1. In Database Explorer, right-click the user type you want to delete and select Delete, or press Delete.
2. Click Yes to confirm the deletion.
Note
You cannot undo the drop operation, as this action permanently deletes its structure. It is recommended that you back up the database before deleting it.
1. In Database Explorer, right-click a required user type and select Generate Script As, then select the statement type.
2. Select the output option:
For more information, see Generate the DDL and DML statements for database objects.
To view properties of a user type, in Database Explorer, right-click the user type or User Types node and select Show Details.
Object Viewer opens and provides detailed information about the user type.
To update the user type to reflect the latest changes, in Database Explorer, right-click the user type or User Types node and select Refresh, or press F5.
To open the Properties window, in Database Explorer, right-click the user type and select Properties, or press F4.
1. In Database Explorer, right-click the Data Types, Table Types, CLR Types, or XML Schema Collections node and select Filter.
2. In the Filter Settings dialog, configure the filter parameters.
3. Click OK to apply the filter.
Note
When you open the Data Types, Table Types, CLR Types, or XML Schema Collections 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, which appear when you right-click a specific user 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, ready to pull 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 user type. The option is unavailable for a CLR user type. |
| Generate Script As | Generates a script of 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 to view object details. |
| Delete | Drops the selected user type from the database. Shortcut: Delete |
| Refresh | Updates the object to reflect the latest changes. Shortcut: F5 |
| Properties | Opens the Properties pane to view the object information. Shortcut: F4 |
The following table describes the shortcut menu options, which appear when you right-click the User 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, ready to pull using Get Latest. When Source Control Manager is already open, this option refreshes it and selects all remote database changes. |
| Show Details | Opens Object Viewer to view 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.