SQL Server类型的对应关系

时间:2022-05-22 16:51:04
bit bool
tinyint byte
smallint short
int int
bigint long
real float
float double
money decimal
datetime DateTime
char char
varchar string
nchar char
nvarchar string
text string
ntext string
image byte[]
binary byte[]
uniqueidentifier Guid
MSSQL Server类型
C#类型

DbType      sqltype

AnsiString:VarChar

Binary:VarBinary

Byte:TinyInt

Boolean:Bit

Currency:Money

Date:DateTime

DateTime:DateTime

Decimal:Decimal

Double:Float

Guid:UniqueIdentifier

Int16:SmallInt

Int32:Int

Int64:BigInt

Object:Variant

Single:Real

String:NVarChar

Time:DateTime

AnsiStringFixedLength:Char

StringFixedLength:NChar

Xml:Xml

DateTime2:DateTime2

DateTimeOffset:DateTimeOffset