Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Enterprise
Expertise: Beginner
Aug 24, 1999



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Always Create User Defined Data Types in the Database

While designing the database for your application, you should always create user defined data types for columns across the database. User-defined data types ensure consistency of column definitions across the database. User-defined datatypes are defined in terms of system datatypes. User-defined datatypes permit frequently used type information to be accessed by a name you choose with a specified rule, default, and display format attached to it. You can create a User-defined datatype using the sp_addtype system stored procedure. You need to create a User-defined datatype before it can be used in a table definition.

Here is an example that creates a user-defined datatype which is based on intrinsic datatype datetime named DateOfBirth that allows null values.

sp_addtype DateOfBirth, datetime, 'NULL'

Deepak Pant
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date