User-defined datatypes overview

Privileges

User-defined datatype allows you to name and design your own datatypes to supplement the system datatypes. A user-defined datatype is defined in terms of system datatypes. You can give one name to a frequently used datatype definition.

The datatype of a table column specifies the kind of information (characters, numbers, or dates) the column holds and how the data is stored. For example, the integer (int) datatype stores whole numbers in the range of minus 2 billion to plus 2 billion. The tiny integer (tinyint) datatype stores whole numbers between 0 and 255.

A user-defined datatype is a customized datatype based on system datatypes. You can give a name to a frequently used datatype definition to save time. Unlike system datatypes, user-defined datatypes are case-sensitive. In addition, if a user-defined datatype has precision, scale, or identity, you cannot overwrite these attributes when you use the datatype to define a table column. When you define a user-defined datatype, you can bind it to rules and defaults.