User-defined types
Overview
User-Defined Types (UDTs) are a user restriction on a built-in type. They can be used as an alias to a built-in type, restricted to a given length/precision.
Examples:
-
GenericNameType type can be defined as a String(80)
-
ZipCodeType can be used as an alias for Decimal(5,0).
Create a user-defined type
To create a user-defined type:
-
Right-click the User-defined Types node and select Add User-defined Type…. The Create New User-defined Type wizard opens.
-
In the Create New User-defined Type wizard, check the Auto Fill option and then enter the following values:
-
Name: Internal name of the user-defined type
-
Label: User-friendly label in this field. Since the Auto Fill checkbox is selected, the Label field is automatically filled in. Modifying this label is optional.
-
Built-in Type: Select a type from the list.
-
Length, Precision, Scale. Size for this user-defined type. The fields available depend on the built-in type selected. For example, a String built-in type will only allow entering a Length.
-
-
Click Finish to close the wizard. The User-defined Type editor opens.
-
In the Description field, optionally enter a description for the user-defined type.
-
Press Control+S (or Command+S on macOS) to save the editor.
-
Close the editor.