With the introduction of the Microsoft SQL Server option for NAV the specific way of sorting Code fields (the Navision way) was no longer possible when running NAV on SQL Server. The Dynamics Book wiki gives a good description on the differences not in the least because of the filtering examples.
As Code fields are text fields the basic sorting mode on SQL Server is a text sorting. However to provide some sort of numerical sorting for Code fields the SQL Data Type property was introduced having the following three options:
In all years those I never did get to explore these different options until a couple of weeks ago. For those, like me, who also did not, some examples.
Design: table with one field (PK) Varchar of Data Type Code with SQL Data Type Varchar (default).
Design: table with one field (PK) Integer of Data Type Code with SQL Data Type Integer.
Design: table with one field (PK) Variant of Data Type Code with SQL Data Type Variant.