Ispirer Website Ispirer Capabilities - Microsoft SQL Server Migration Free Trial

Microsoft SQL Server - Data Types

Versions: SQL Server 2008, 2005, 2000, 7.0 and 6.5

Data Type Parameters and Range
Character Data Types
CHAR(n) - Fixed-length character data 1 ⇐ n ⇐ 8000, default is 1
NCHAR(n) - Fixed-length character data in Unicode - UCS-2 1 ⇐ n ⇐ 4000, default is 1
VARCHAR(n | max) - Variable-length character data 1 ⇐ n ⇐ 8000, default is 1, 2G if max is specified
NVARCHAR(n | max) - Variable-length character data in Unicode - UCS-2 1 ⇐ n ⇐ 4000, default is 1, 2G if max is specified
TEXT - Variable-length character data (large object) 2G - not recommended for use (will be removed in future versions)
NTEXT - Variable-length character data (large object) in Unicode - UCS-2 1G - not recommended for use (will be removed in future versions)
Integer Data Types
BIGINT - 64-bit integer data -263 to 263-1
INT, INTEGER - 32-bit integer data -231 to 231-1 (2G)
SMALLINT - 16-bit integer data -32768 to 32767
TINYINT - 8-bit integer data 0 to 255
Decimal Data Types
DECIMAL(p,s), NUMERIC(p,s) - Fixed-point numeric data 1 ⇐ p ⇐ 38, default is 18; 0 ⇐ s ⇐ p, default is 0
Floating-Point Data Types
FLOAT(p) - Floating-point numeric data 1E-308 to 1E+308, 1 ⇐ p ⇐ 53, default is 53
REAL - 32-bit floating-point numeric data 1E-38 to 1E+38
DOUBLE PRECISION - 64-bit floating-point numeric data 1E-308 to 1E+308
Date and Time Data Types
DATE - Date data (year, month and day) January 01, 0001 to December 31, 9999
TIME(p) - Time data (hours, minutes, seconds and fraction of seconds) 00:00:00.0000000 to 23:59:59.9999999
0 ⇐ p ⇐ 7, default is 7 (100 nanoseconds)
DATETIME - Date and time data (year, month, day, hours, minutes,
seconds and 1/300 seconds)
January 01, 1753 00:00:00.000 to December 31, 9999 11:59:59.997
DATETIME2(p) - Date and time data (year, month, day, hours, minutes,
seconds and fractional seconds)
January 1, 0001 00:00:00.0000000 to December 31, 9999 23:59:59.0000000
0 ⇐ p ⇐ 7, default is 7 (100 nanoseconds)
DATETIMEOFFSET(p) - Date and time data with time zone (year, month, day, hours,
minutes, seconds and fractional seconds)
January 1, 0001 00:00:00.0000000 to December 31, 9999 23:59:59.0000000
0 ⇐ p ⇐ 7, default is 7 (100 nanoseconds)
SMALLDATETIME - Date and time data (year, month, day, hours and minutes) January 01, 1900 12:00 AM to June 06, 2079 11:59 PM
Binary Data Types
BINARY(n) - Fixed-length binary data 1 ⇐ n ⇐ 8000, default is 1
VARBINARY(n | max) - Variable-length binary data 1 ⇐ n ⇐ 8000, default is 1, 2G if max is specified
IMAGE - Variable-length binary data 2G - not recommended for use (will be removed in future versions)
Other Data Types
BIT - Boolean data 0, 1 and NULL
UNIQUEIDENTIFIER - Globally unique identifier (GUID)
XML - XML data 2G
MONEY - Monetary data -922,337,203,685,477.5808 to 922,337,203,685,477.5807
SMALLMONEY - Monetary data -214,748.3648 to 214,748.3647
TIMESTAMP, ROWVERSION - Automatically updated binary data

Data Types in Other Databases


© 1999-2024, Ispirer Systems, LLC. All Rights Reserved.