Acu4GL for MSSQL returns the wrong row on START NOT GREATER, READ PREVIOUS.

0 Likes

Problem:

Application runs against a MSSQL 2005 database.  It moves high-values to the key, or part of a key, does a START NOT GREATER, then a READ PREVIOUS.  The wrong row is being returned. If run against Vision files containing the same data the expected record is found.

For example when the entire key is set to high-values the very last record in the Vision file is returned.  However, with Acu4GL for MSSQL, it returns a row somewhere near the end of the table or even the second to last row, never the last row.

Resolution:

The problem is that the database collating sequence is not binary.

The server's default collating sequence is chosen on installation of MSSQL, however a different collating sequence for individual databases using the alter SQL command can be specified by issuing the follow SQL command:

alter database databasename collate SQL_Latin1_General_CP850P_Bin

It can also be modified by using the Microsoft SQL Server Management Studio.  Right-click on the database, select Properties, Options, and make the SQL_Latin1_General_CP850P_Bin selection in the Collation list-box.

Another way to address this is to have the application initialize character key fields to z and numeric key fields to 9, rather than moving high-values.

Old KB# 2831
Comment List
Anonymous
Related Discussions
Recommended