.NET Framework Data Provider for SQL Server Types (Entity Framework)
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.
The following table describes types for SQL Server 2005 and SQL Server 2000 databases and how these types map to Entity Data Model (EDM) types. Some new types were introduced in SQL Server 2005 and are not supported in SQL Server 2000. These types are noted in the table below.
Provider type name | Provider type attributes | EDM type name | EDM type facets |
---|---|---|---|
bit |
n/a |
Boolean |
n/a |
tinyint |
n/a |
Byte |
n/a |
smallint |
n/a |
Int16 |
n/a |
int |
n/a |
Int32 |
n/a |
bigint |
n/a |
Int64 |
n/a |
float |
n/a |
Double |
n/a |
real |
n/a |
Single |
n/a |
decimal |
n/a |
Decimal |
Facet name Attribute name Value
Precision Minimum Maximum Default Constant 1 38 18 False
Scale Minimum Maximum Default Constant 0 38 0 False
|
numeric |
n/a |
Decimal |
Facet name Attribute name Value
Precision Minimum Maximum Default Constant 1 38 18 False
Scale Minimum Maximum Default Constant 0 38 0 False
|
smallmoney |
n/a |
Decimal |
Facet name Attribute name Value
Precision Default Constant 10 True
Scale Default Constant 4 True
|
money |
n/a |
Decimal |
Facet name Attribute name Value
Precision Default Constant 19 True
Scale Default Constant 4 True
|
binary |
n/a |
Binary |
Facet name Attribute name Value
MaxLength Minimum Maximum Default Constant 1 8000 8000 False
FixedLength Default Constant True True
|
varbinary |
n/a |
Binary |
Facet name Attribute name Value
MaxLength Minimum Maximum Default Constant 1 8000 8000 False
FixedLength Default Constant False True
|
varbinary(max)
Note
This type is not supported in SQL Server 2000.
|
n/a |
Binary |
Facet name Attribute name Value
MaxLength Default Constant 214748364780 True
FixedLength Default Constant False True
|
image |
n/a |
Binary |
Facet name Attribute name Value
MaxLength Default Constant 2147483647 True
FixedLength Default Constant False True
|
timestamp |
n/a |
Binary |
Facet name Attribute name Value
MaxLength Default Constant 8 True
FixedLength Default Constant True True
|
rowversion |
n/a |
Binary |
Facet name Attribute name Value
MaxLength Default Constant 8 True
FixedLength Default Constant True True
|
smalldatetime |
n/a |
DateTime |
Facet name Attribute name Value
Precision Default Constant 0 True
|
datetime |
n/a |
DateTime |
Facet name Attribute name Value
Precision Default Constant 3 True
|
date
Note
This type is not supported in SQL Server 2005 and SQL Server 2000.
|
n/a |
DateTime |
Facet name Attribute name Value
Precision Default Constant 0 Flase
|
time
Note
This type is not supported in SQL Server 2005 and SQL Server 2000.
|
n/a |
Time |
Facet name Attribute name Value
Precision Default Constant 7 Flalse
|
datetime2
Note
This type is not supported in SQL Server 2005 and SQL Server 2000.
|
n/a |
DateTime |
Facet name Attribute name Value
Precision Default Constant 7 Flalse
|
datetimeoffset
Note
This type is not supported in SQL Server 2005 and SQL Server 2000.
|
n/a |
DateTimeOffset |
Facet name Attribute name Value
Precision Default Constant 7 Flalse
|
nvarchar
Note
This type is not supported in SQL Server 2000.
|
n/a |
String |
Facet name Attribute name Value
MaxLength Minimum Maximum Default Constant 1 4000 4000 False
Unicode Default Constant True True
FixedLength Default Constant False True
|
varchar
Note
This type is not supported in SQL Server 2000.
|
n/a |
String |
Facet name Attribute name Value
MaxLength Minimum Maximum Default Constant 1 8000 8000 False
Unicode Default Constant False True
FixedLength Default Constant False True
|
char |
n/a |
String |
Facet name Attribute name Value
MaxLength Minimum Maximum Default Constant 1 8000 8000 False
Unicode Default Constant False True
FixedLength Default Constant True True
|
nchar |
n/a |
String |
Facet name Attribute name Value
MaxLength Minimum Maximum Default Constant 1 4000 4000 False
Unicode Default Constant True True
FixedLength Default Constant True True
|
varchar(max) |
n/a |
String |
Facet name Attribute name Value
MaxLength Default Constant 2147483647 True
Unicode Default Constant False True
FixedLength Default Constant False True
|
nvarchar(max) |
n/a |
String |
Facet name Attribute name Value
MaxLength Default Constant 1073741823 True
Unicode Default Constant True True
FixedLength Default Constant False True
|
ntext |
Attribute name Value
Equal comparable False
Order comparable False
|
String |
Facet name Attribute name Value
MaxLength Default Constant 1073741823 True
Unicode Default Constant False True
FixedLength Default Constant False True
|
text |
Attribute name Value
Equal comparable False
Order comparable False
|
String |
Facet name Attribute name Value
MaxLength Default Constant 2147483647 True
Unicode Default Constant False True
FixedLength Default Constant False True
|
Unique identifier |
Attribute name Value
Equal comparable True
Order comparable True
|
Guid |
n/a |
xml |
Attribute name Value
Equal comparable False
Order comparable False
|
String |
Facet name Attribute name Value
MaxLength Default Constant 1073741823 True
Unicode Default Constant True True
FixedLength Default Constant False True
|