-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
On DbTypes x SqlServer is documented that the types generated for DbType.Binary is the following:
- binary
Based on , if the size of binary is not specifed the declaration is same as binary(1)
Also, based on SQL Server Data Type Mappings the type used for DbType.Binary could be binary, varbinary or image.
SQL Server image datatype is deprecated, but should be used for SQL Server 2005 or older.
We can not know only based on enumeration if user want to use binary or varbinary so a decision must be made between one of the following options:
Use binary:
- binary if precision is not specified (to remain compatible with previous behavior)
- binary(n) for precision between 1 and 8000
- throw an exception if precison is greate than 8000
Use varbinary:
- varbinary(1) if precision is not specified (to remain compatible with previous behavior)
- varbinary(n) for precision between 1 and 8000
- varbinary(max) if precision is greater than 8000
Metadata
Metadata
Assignees
Labels
No labels