整數(shù)
bigint
從 -2^63 (-9223372036854775808) 到 2^63-1 (9223372036854775807) 的整型數(shù)據(jù)(所有數(shù)字)。
int
從 -2^31 (-2,147,483,648) 到 2^31 - 1 (2,147,483,647) 的整型數(shù)據(jù)(所有數(shù)字)。
smallint
從 -2^15 (-32,768) 到 2^15 - 1 (32,767) 的整數(shù)數(shù)據(jù)。
tinyint
從 0 到 255 的整數(shù)數(shù)據(jù)。
bit
bit
1 或 0 的整數(shù)數(shù)據(jù)。
decimal 和 numeric
decimal
從 -10^38 +1 到 10^38 –1 的固定精度和小數(shù)位的數(shù)字?jǐn)?shù)據(jù)。
numeric
功能上等同于 decimal。
money 和 smallmoney
money
貨幣數(shù)據(jù)值介于 -2^63 (-922,337,203,685,477.5808) 與 2^63 - 1 (+922,337,203,685,477.5807) 之間,精確到貨幣單位的千分之十。
smallmoney
貨幣數(shù)據(jù)值介于 -214,748.3648 與 +214,748.3647 之間,精確到貨幣單位的千分之十。
近似數(shù)字
float
從 -1.79E + 308 到 1.79E + 308 的浮點(diǎn)精度數(shù)字。
real
從 -3.40E + 38 到 3.40E + 38 的浮點(diǎn)精度數(shù)字。
datetime 和 smalldatetime
datetime
從 1753 年 1 月 1 日到 9999 年 12 月 31 日的日期和時間數(shù)據(jù),精確到百分之三秒(或 3.33 毫秒)。
smalldatetime
從 1900 年 1 月 1 日到 2079 年 6 月 6 日的日期和時間數(shù)據(jù),精確到分鐘。
字符串
char
固定長度的非 Unicode 字符數(shù)據(jù),最大長度為 8,000 個字符。
varchar
可變長度的非 Unicode 數(shù)據(jù),最長為 8,000 個字符。
text
可變長度的非 Unicode 數(shù)據(jù),最大長度為 2^31 - 1 (2,147,483,647) 個字符。
Unicode 字符串
nchar
固定長度的 Unicode 數(shù)據(jù),最大長度為 4,000 個字符。
nvarchar
可變長度 Unicode 數(shù)據(jù),其最大長度為 4,000 字符。sysname 是系統(tǒng)提供用戶定義的數(shù)據(jù)類型,在功能上等同于 nvarchar(128),用于引用數(shù)據(jù)庫對象名。
ntext
可變長度 Unicode 數(shù)據(jù),其最大長度為 2^30 - 1 (1,073,741,823) 個字符。
二進(jìn)制字符串
binary
固定長度的二進(jìn)制數(shù)據(jù),其最大長度為 8,000 個字節(jié)。
varbinary
可變長度的二進(jìn)制數(shù)據(jù),其最大長度為 8,000 個字節(jié)。
image
可變長度的二進(jìn)制數(shù)據(jù),其最大長度為 2^31 - 1 (2,147,483,647) 個字節(jié)。
其它數(shù)據(jù)類型
cursor
游標(biāo)的引用。
sql_variant
一種存儲 SQL Server 支持的各種數(shù)據(jù)類型(text、ntext、timestamp 和 sql_variant 除外)值的數(shù)據(jù)類型。
table
一種特殊的數(shù)據(jù)類型,存儲供以后處理的結(jié)果集。
timestamp
數(shù)據(jù)庫范圍的唯一數(shù)字,每次更新行時也進(jìn)行更新。