K2 SmartObjects and Attachments

The K2 ServiceObject for SQL does not support some field types, one of them being varbinay, so to upload attachments you need to use nvarchar(MAX) as your database column type for the K2 ServiceObject to become aware of it.

The reason for this is because K2 serialises attachments as XML strings and there for required the field nvarchar(MAX).

The following fields are not supported by the SQL Service Objects

– TimeStamp
– Image
– SQL_Variant
– Binary
– VarBinary
– Numeric

Another way to easily store documents is to use a SharePoint document library.