適用於 Entity Framework 之 SqlClient 的類型SqlClient for Entity FrameworkTypes

.NET Framework Data Provider for SQL Server (SqlClient) 提供者資訊清單檔案包含下列的清單:提供者基本型別 (Primitive Type)、每個型別的 Facet、概念和儲存體模型基本型別之間的對應,以及概念和儲存體模型基本型別之間的提升及轉換規則。The .NET Framework Data Provider for SQL Server (SqlClient) provider manifest file includes the list of the provider primitive types, facets for each type, the mappings between the conceptual and storage model primitive types, and the promotion and conversion rules between the conceptual and storage model primitive types.

下表描述 SQL Server 2008,SQL Server 2005 和 SQL Server 2000 資料庫和這些類型如何對應至概念模型類型的類型。The following table describes types for SQL Server 2008, SQL Server 2005, and SQL Server 2000 databases and how these types map to conceptual model types. 較新的 SQL Server 版本中引進了一些新的型別,但是舊版的 SQL Server 並不支援這些型別。Some new types were introduced in later versions of SQL Server are not supported in the older versions of SQL Server. 下表會說明這些類型。These types are noted in the table below.

提供者類型Provider type

名稱name
提供者類型Provider type

屬性attributes
EDMSimpleType

名稱name
FacetFacets
bit N/An/a Edm.Boolean N/An/a
tinyint N/An/a Edm.Byte N/An/a
smallint N/An/a Edm.Int16 N/An/a
int N/An/a Edm.Int32 N/An/a
bigint N/An/a Edm.Int64 N/An/a
float N/An/a Edm.Double N/An/a
real N/An/a Edm.Double N/An/a
decimal N/An/a Edm.Decimal 有效位數:Precision:

最小值:1- Minimum: 1

最大值:38- Maximum: 38

-預設值:18- Default: 18

-常數:False- Constant: False

小數位數:Scale:

最小值:0- Minimum: 0

最大值:38- Maximum: 38

-預設值:0- Default: 0

-常數:False- Constant: False
numeric N/An/a Edm.Decimal 有效位數:Precision:

最小值:1- Minimum: 1

最大值:38- Maximum: 38

-預設值:18- Default: 18

-常數:False- Constant: False

小數位數:Scale:

最小值:0- Minimum: 0

最大值:38- Maximum: 38

-預設值:0- Default: 0

-常數:False- Constant: False
smallmoney N/An/a Edm.Decimal 有效位數:Precision:

-預設值:10- Default: 10

-常數:True- Constant: True

小數位數:Scale:

-預設值:4- Default: 4

-常數:True- Constant: True
money N/An/a Edm.Decimal 有效位數:Precision:

-預設值:19- Default: 19

-常數:True- Constant: True

小數位數:Scale:

-預設值:4- Default: 4

-常數:True- Constant: True
binary N/An/a Edm.Binary MaxLength:MaxLength:

最小值:1- Minimum: 1

最大值:8000- Maximum: 8000

-預設值:8000- Default: 8000

-常數:False- Constant: False

FixedLength:FixedLength:

-預設值:True- Default: True

-常數:True- Constant: True
varbinary N/An/a Edm.Binary MaxLength:MaxLength:

最小值:1- Minimum: 1

最大值:8000- Maximum: 8000

-預設值:8000- Default: 8000

-常數:False- Constant: False

FixedLength:FixedLength:

-預設值:False- Default: False

-常數:True- Constant: True
varbinary(max)

注意:SQL Server 2000 中不支援此類型。Note: This type is not supported in SQL Server 2000.
N/An/a Edm.Binary MaxLength:MaxLength:

-預設值:214748364780- Default: 214748364780

-常數:True- Constant: True

FixedLength:FixedLength:

-預設值:False- Default: False

-常數:True- Constant: True
image N/An/a Edm.Binary MaxLength:MaxLength:

-預設值:2147483647- Default: 2147483647

-常數:True- Constant: True

FixedLength:FixedLength:

-預設值:False- Default: False

-常數:True- Constant: True
timestamp N/An/a Edm.Binary MaxLength:MaxLength:

-預設值:8- Default: 8

-常數:True- Constant: True

FixedLength:FixedLength:

-預設值:True- Default: True

-常數:True- Constant: True
rowversion N/An/a Edm.Binary MaxLength:MaxLength:

-預設值:8- Default: 8

-常數:True- Constant: True

FixedLength:FixedLength:

-預設值:True- Default: True

-常數:True- Constant: True
smalldatetime N/An/a Edm.DateTime 有效位數:Precision:

-預設值:0- Default: 0

-常數:True- Constant: True
datetime N/An/a Edm.DateTime 有效位數:Precision:

-預設值:3- Default: 3

-常數:True- Constant: True
date

注意:在 SQL Server 2005 和 SQL Server 2000 中不支援此類型。Note: This type is not supported in SQL Server 2005 and SQL Server 2000.
N/An/a Edm.DateTime 有效位數:Precision:

-預設值:0- Default: 0

-常數:False- Constant: False
time

注意:在 SQL Server 2005 和 SQL Server 2000 中不支援此類型。Note: This type is not supported in SQL Server 2005 and SQL Server 2000.
N/An/a Edm.Time 有效位數:Precision:

-預設值:7- Default: 7

-常數:False- Constant: False
datetime2

注意:在 SQL Server 2005 和 SQL Server 2000 中不支援此類型。Note: This type is not supported in SQL Server 2005 and SQL Server 2000.
N/An/a Edm.DateTime 有效位數:Precision:

-預設值:7- Default: 7

-常數:False- Constant: False
datetimeoffset

注意:在 SQL Server 2005 和 SQL Server 2000 中不支援此類型。Note: This type is not supported in SQL Server 2005 and SQL Server 2000.
N/An/a Edm.DateTimeOffset 有效位數:Precision:

-預設值:7- Default: 7

-常數:False- Constant: False
nvarchar

注意:SQL Server 2000 中不支援此類型。Note: This type is not supported in SQL Server 2000.
N/An/a Edm.String MaxLength:MaxLength:

最小值:1- Minimum: 1

最大值:4000- Maximum: 4000

-預設值:4000- Default: 4000

-常數:False- Constant: False

Unicode:Unicode:

-預設值:True- Default: True

-常數:True- Constant: True

FixedLength:FixedLength:

-預設值:False- Default: False

-常數:True- Constant: True
varchar

注意:SQL Server 2000 中不支援此類型。Note: This type is not supported in SQL Server 2000.
N/An/a Edm.String MaxLength:MaxLength:

最小值:1- Minimum: 1

最大值:8000- Maximum: 8000

-預設值:8000- Default: 8000

-常數:False- Constant: False

Unicode:Unicode:

-預設值:False- Default: False

-常數:True- Constant: True

FixedLength:FixedLength:

-預設值:False- Default: False

-常數:True- Constant: True
char N/An/a Edm.String MaxLength:MaxLength:

最小值:1- Minimum: 1

最大值:8000- Maximum: 8000

-預設值:8000- Default: 8000

-常數:False- Constant: False

Unicode:Unicode:

-預設值:False- Default: False

-常數:True- Constant: True

FixedLength:FixedLength:

-預設值:True- Default: True

-常數:True- Constant: True
nchar N/An/a Edm.String MaxLength:MaxLength:

最小值:1- Minimum: 1

最大值:4000- Maximum: 4000

-預設值:4000- Default: 4000

-常數:False- Constant: False

Unicode:Unicode:

-預設值:True- Default: True

-常數:True- Constant: True

FixedLength:FixedLength:

-預設值:True- Default: True

-常數:True- Constant: True
varchar(max)varchar(max) N/An/a Edm.String MaxLength:MaxLength:

-預設值:2147483647- Default: 2147483647

-常數:True- Constant: True

Unicode:Unicode:

-預設值:False- Default: False

-常數:True- Constant: True

FixedLength:FixedLength:

-預設值:False- Default: False

-常數:True- Constant: True
nvarchar(max)nvarchar(max) N/An/a Edm.String MaxLength:MaxLength:

-預設值:1073741823- Default: 1073741823

-常數:True- Constant: True

Unicode:Unicode:

-預設值:True- Default: True

-常數:True- Constant: True

FixedLength:FixedLength:

-預設值:False- Default: False

-常數:True- Constant: True
ntext 等號比較:FalseEqual comparable: False

可比較順序:FalseOrder comparable: False
Edm.String MaxLength:MaxLength:

-預設值:1073741823- Default: 1073741823

-常數:True- Constant: True

Unicode:Unicode:

-預設值:False- Default: False

-常數:True- Constant: True

FixedLength:FixedLength:

-預設值:False- Default: False

-常數:True- Constant: True
text 等號比較:FalseEqual comparable: False

可比較順序:FalseOrder comparable: False
Edm.String MaxLength:MaxLength:

-預設值:2147483647- Default: 2147483647

-常數:True- Constant: True

Unicode:Unicode:

-預設值:False- Default: False

-常數:True- Constant: True

FixedLength:FixedLength:

-預設值:False- Default: False

-常數:True- Constant: True
Unique

identifier
等號比較:TrueEqual comparable: True

可比較順序:TrueOrder comparable: True
Edm.Guid N/An/a
xml 等號比較:FalseEqual comparable: False

可比較順序:FalseOrder comparable: False
Edm.String MaxLength:MaxLength:

-預設值:1073741823- Default: 1073741823

-常數:True- Constant: True

Unicode:Unicode:

-預設值:True- Default: True

-常數:True- Constant: True

FixedLength:FixedLength:

-預設值:False- Default: False

-常數:True- Constant: True

另請參閱See also