Uploaded image for project: 'i2b2 Core Software'
  1. i2b2 Core Software
  2. CORE-227

Add ability to send parameters with string based variables as varchar instead of nvarchar

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Completed
    • 1.7.07
    • 1.7.08
    • CRC Cell
    • None
    • Rank:
      0|i0031j:
    • i2b2 Core
    • SQL Server

    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.

      Attachments

        Activity

          People

            jmd86 Janice Donahoe
            jmd86 Janice Donahoe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: