SqlClient for Entity FrameworkTypes

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 2008, SQL Server 2005, and SQL Server 2000 databases and how these types map to conceptual model types. 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
Facets
bit n/a Edm.Boolean n/a
tinyint n/a Edm.Byte n/a
smallint n/a Edm.Int16 n/a
int n/a Edm.Int32 n/a
bigint n/a Edm.Int64 n/a
float n/a Edm.Double n/a
real n/a Edm.Double n/a
decimal n/a Edm.Decimal Precision:

- Minimum: 1

- Maximum: 38

- Default: 18

- Constant: False

Scale:

- Minimum: 0

- Maximum: 38

- Default: 0

- Constant: False
numeric n/a Edm.Decimal Precision:

- Minimum: 1

- Maximum: 38

- Default: 18

- Constant: False

Scale:

- Minimum: 0

- Maximum: 38

- Default: 0

- Constant: False
smallmoney n/a Edm.Decimal Precision:

- Default: 10

- Constant: True

Scale:

- Default: 4

- Constant: True
money n/a Edm.Decimal Precision:

- Default: 19

- Constant: True

Scale:

- Default: 4

- Constant: True
binary n/a Edm.Binary MaxLength:

- Minimum: 1

- Maximum: 8000

- Default: 8000

- Constant: False

FixedLength:

- Default: True

- Constant: True
varbinary n/a Edm.Binary MaxLength:

- Minimum: 1

- Maximum: 8000

- Default: 8000

- Constant: False

FixedLength:

- Default: False

- Constant: True
varbinary(max)

Note: This type is not supported in SQL Server 2000.
n/a Edm.Binary MaxLength:

- Default: 214748364780

- Constant: True

FixedLength:

- Default: False

- Constant: True
image n/a Edm.Binary MaxLength:

- Default: 2147483647

- Constant: True

FixedLength:

- Default: False

- Constant: True
timestamp n/a Edm.Binary MaxLength:

- Default: 8

- Constant: True

FixedLength:

- Default: True

- Constant: True
rowversion n/a Edm.Binary MaxLength:

- Default: 8

- Constant: True

FixedLength:

- Default: True

- Constant: True
smalldatetime n/a Edm.DateTime Precision:

- Default: 0

- Constant: True
datetime n/a Edm.DateTime Precision:

- Default: 3

- Constant: True
date

Note: This type is not supported in SQL Server 2005 and SQL Server 2000.
n/a Edm.DateTime Precision:

- Default: 0

- Constant: False
time

Note: This type is not supported in SQL Server 2005 and SQL Server 2000.
n/a Edm.Time Precision:

- Default: 7

- Constant: False
datetime2

Note: This type is not supported in SQL Server 2005 and SQL Server 2000.
n/a Edm.DateTime Precision:

- Default: 7

- Constant: False
datetimeoffset

Note: This type is not supported in SQL Server 2005 and SQL Server 2000.
n/a Edm.DateTimeOffset Precision:

- Default: 7

- Constant: False
nvarchar

Note: This type is not supported in SQL Server 2000.
n/a Edm.String MaxLength:

- Minimum: 1

- Maximum: 4000

- Default: 4000

- Constant: False

Unicode:

- Default: True

- Constant: True

FixedLength:

- Default: False

- Constant: True
varchar

Note: This type is not supported in SQL Server 2000.
n/a Edm.String MaxLength:

- Minimum: 1

- Maximum: 8000

- Default: 8000

- Constant: False

Unicode:

- Default: False

- Constant: True

FixedLength:

- Default: False

- Constant: True
char n/a Edm.String MaxLength:

- Minimum: 1

- Maximum: 8000

- Default: 8000

- Constant: False

Unicode:

- Default: False

- Constant: True

FixedLength:

- Default: True

- Constant: True
nchar n/a Edm.String MaxLength:

- Minimum: 1

- Maximum: 4000

- Default: 4000

- Constant: False

Unicode:

- Default: True

- Constant: True

FixedLength:

- Default: True

- Constant: True
varchar(max) n/a Edm.String MaxLength:

- Default: 2147483647

- Constant: True

Unicode:

- Default: False

- Constant: True

FixedLength:

- Default: False

- Constant: True
nvarchar(max) n/a Edm.String MaxLength:

- Default: 1073741823

- Constant: True

Unicode:

- Default: True

- Constant: True

FixedLength:

- Default: False

- Constant: True
ntext Equal comparable: False

Order comparable: False
Edm.String MaxLength:

- Default: 1073741823

- Constant: True

Unicode:

- Default: False

- Constant: True

FixedLength:

- Default: False

- Constant: True
text Equal comparable: False

Order comparable: False
Edm.String MaxLength:

- Default: 2147483647

- Constant: True

Unicode:

- Default: False

- Constant: True

FixedLength:

- Default: False

- Constant: True
Unique

identifier
Equal comparable: True

Order comparable: True
Edm.Guid n/a
xml Equal comparable: False

Order comparable: False
Edm.String MaxLength:

- Default: 1073741823

- Constant: True

Unicode:

- Default: True

- Constant: True

FixedLength:

- Default: False

- Constant: True

See also