--- title: "Sorting Limitations | Microsoft Docs" ms.custom: "" ms.date: "01/19/2017" ms.prod: sql ms.prod_service: connectivity ms.reviewer: "" ms.technology: connectivity ms.topic: conceptual helpviewer_keywords: - "ODBC desktop database drivers [ODBC]" - "desktop database drivers [ODBC]" ms.assetid: 2273e058-f6a3-4fc3-875f-e506cb1015ac author: David-Engel ms.author: v-daenge --- # Sorting Limitations The maximum length of a sort key in a GROUP BY clause, ORDER BY clause, SELECT DISTINCT statement, or outer join is 255 bytes; the maximum length of all sort keys in a sort row is 65,500 bytes.