Getting List of Data Types using system function in SQL Server 2008

By using this we can get all the available data types in the sql server.

select * from sys.types

User defined datatype:

select * from sys.types where is_user_defined=1

System datatype:

select * from sys.types where is_user_defined=0

Name - Name of the datatype.
max_length - Maximum char length of the column.

Other useful columns to notify : Scale,Precision,is_nullable

Output:

name
image
text
uniqueidentifier
date
time
datetime2
datetimeoffset
tinyint
smallint
int
smalldatetime
real
money
datetime
float
sql_variant
ntext
bit
decimal
numeric
smallmoney
bigint
hierarchyid
geometry
geography
varbinary
varchar
binary
char
timestamp
nvarchar
nchar
xml
sysname
Ebook Download
View all
Learn
View all