Hvis du har SQL 2008, kan du bruge den nye hierarkiske datatype:
WITH Items (ItemNumber) AS (
SELECT '1' UNION ALL SELECT '1.1' UNION ALL SELECT '1.1.1'
UNION ALL SELECT '10' UNION ALL SELECT '11' UNION ALL SELECT '2'
UNION ALL SELECT '2.1' UNION ALL SELECT '20' UNION ALL SELECT '3'
UNION ALL SELECT '30'
)
SELECT *
FROM Items
ORDER BY Convert(hierarchyid, '/' + ItemNumber + '/');