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:

1 ERROR [42000] [Microsoft][SQL Server Native Client 10.0][SQL Server]The data types nvarchar and ntext are incompatible in the equal to operator.

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

Status

Assignee

Frédéric Delaporte

Reporter

Frédéric Delaporte

Labels

None

Components

Fix versions

Affects versions

5.0.0

Priority

Minor
Configure