ODBC nvarchar parameter corruption

Description

When nvarchar parameter length exceeds or equals 2000, ODBC transmit the parameter as ntext, which causes SQL comparisons to fail with message:

The ODBC driver set the length of parameter when its mapped type provide it. It is ignored in 4.1.1 because it later recreates parameters by losing some of their settings. But this may be fixed. It should cease specifying Size on parameters as it may cause bugs if this setting in no more lost on subsequent operations as it is currently.

Environment

None

Activity

Show:
Frédéric Delaporte
September 26, 2017, 1:36 PM
Edited

This will just mitigate the trouble for cases where the parameter actual value is shorter than 2000 characters. But if the parameter value is actually reaching the 2000 characters length, the trouble will still be there. This value case cannot be fixed by NHibernate, it should be considered an external trouble. This trouble is also described here.

Assignee

Frédéric Delaporte

Reporter

Frédéric Delaporte

Labels

None

Components

Fix versions

Affects versions

Priority

Minor
Configure