When using BLOBs with more than 8000 bytes of data, you need to specifically set Parameter.SqlDbType = SqlDbType.Image
to make it work (as explained here).
Dapper, when it sees a byte[]
field, defaults to a SqlDbType.Binary
, which means for larger blobs, the inserts and updates will fail with a data truncation error.
Is there an elegant solution to this problem? Only option I can see is to code the entire transaction with ADO.NET methods.