Sort alphanumeric values

Or just order by an EBCDIC collation. eg

ORDER BY TrackNumber COLLATE SQL_EBCDIC1141_CP1_CS_AS

ie In ASCII numbers come before letters but in EBCDIC numbers come after letters.

ps I am not sure what EBCDIC collations are in SQL2014 but they can be found with:

SELECT [name], [Description]
FROM sys.fn_helpcollations()
WHERE [name] LIKE '%EBCDIC%';
1 Like