Affects Version/s: 2.0.4
Fix Version/s: None
Environment:XAMP, MsSQL-Server 2008, PHP 5.3.x, MS pdo_sqlsrv_vc6_ts.dll
When trying to insert a value into a Column with type 'image', 'binary' or 'varbinary' the SQLServer states that this is not possible.
When trying to insert into 'binary' or 'varbinary' the error message is:
=> Implicit conversion from nvarchar(max) datatype to varbinary(max) is not allowed.
When trying to insert into 'image' the error message is:
=> Operand collision: nvarchar(max) is incompatible with image.
Doctrine prepares the image/binary/varbinary column in the statements as nvarchar(max) which is wrong.
The cause of this error is that in the MsSQLPlatform::getVarcharTypeDeclarationSQLSnippet($length, $fixed),
or in the datatype mapping which is to 'text'.
The documentation for the MsSQLServer states following conversions (http://184.108.40.206/de-de/library/ms187928.aspx):
*char => binary/varbinary : Explicit conversion
nchar/nvarchar => image : IMPOSSIBLE
So the solution would be, either to leave the datatype blank or use the char/varchar datatype when saving into image/binary/varbinary, which would cause an extra datatype as those would collide with 'text' I guess.