Details
Description
Currently when prepared statements are used to pass in string based variables, the parameters are sent in the SQL statement as Unicode (nvarchar) instead of varchar. The SQL Server then has to explicitly convert the nvarchar to varchar in the query. The effect is that the SQL Server optimizer may have to use an index scan instead of an index seek, which is the faster of the two.
The solution is to add a new connection parameter to the datasource definition. The value defined for this new connection parameter will determine whether the parameters with string based variables are sent as nvarchar or varchar.
Parameter: <connection-property name="sendStringParametersAsUnicode">
Located in:
Behavior:
Value = ‘false’ the parameter will be sent as varchar
Value = ‘true’ the parameter will continue to be sent as Unicode (‘nvarchar’)
If the parameter is missing the system will continue with the current logic.
IMPORTANT: This change only affects SQL Server databases.
The solution is to add a new connection parameter to the datasource definition. The value defined for this new connection parameter will determine whether the parameters with string based variables are sent as nvarchar or varchar.
Parameter: <connection-property name="sendStringParametersAsUnicode">
Located in:
Behavior:
Value = ‘false’ the parameter will be sent as varchar
Value = ‘true’ the parameter will continue to be sent as Unicode (‘nvarchar’)
If the parameter is missing the system will continue with the current logic.
IMPORTANT: This change only affects SQL Server databases.