SQL Server 中的数据类型在 C 语言中的对应类型如下:
int / smallint / tinyint : int
bigint : long long
float : float
real : double
money / smallmoney : double
decimal / numeric : structure (decimal or numeric)
date / datetime / datetime2 : structure (date, time, or datetime)
char / varchar : char array
nchar / nvarchar : wchar_t array
text / ntext : char pointer (string)
binary / varbinary : void pointer (byte array)
image : void pointer (byte array)
注意: 这些映射可能会因编译器和编译选项的不同而有所不同。