SharpTools / sharpdata

An awesome ORM for querying and modifying databases
MIT License
11 stars 6 forks source link

Data type for SQL Server for DbType.Binary #12

Closed beppler closed 5 years ago

beppler commented 6 years ago

On DbTypes x SqlServer is documented that the types generated for DbType.Binary is the following:

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:

Use varbinary:

beppler commented 6 years ago

I've created a project fork at https://github.com/mpsinfo/sharpdata that contains this update using the varbinary option.

beppler commented 5 years ago

Resolved by #19.