Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Sorting in Temporary tables varies from sorting in a real SQL table in Microsoft Dynamics NAV


Symptoms

When using a temporary table in NAV C/AL code, the sorting in the temporary is the same as when running on a Native database server. This can vary from the sorting you will get on SQL Server, so when running NAV on a SQL Server, then the same data can be sorted in two different ways, depending on whether the table is temporary, or the table is a normal table.

↑ Back to the top


Cause

The feature of using temporary tables was designed a long time before the SQL option was introduced. On SQL Server, it is known that sorting of alpha-numeric data can be different than on the Native database. For example, on Native, you would get this sort order in a code field:

1
2
10

The same table running on a SQL Server (provided the field is of type Code or Text) would be:

1
10
2

So a C/AL developer should be aware that when using a temporary table on the SQL option, the sorting may be different than expected.

This is by design from the time before the SQL option was introduced. And in the interest of backwards compatibility, it will not be changed.

↑ Back to the top


More Information

 

↑ Back to the top


Keywords: kbmbsmigrate, kbmbspartner, vkball, kb

↑ Back to the top

Article Info
Article ID : 2425765
Revision : 2
Created on : 1/27/2017
Published on : 1/27/2017
Exists online : False
Views : 106