SAP Knowledge Base Article - Public

1217148 - What is the maximum size for a SQL Query added to a Command in Crystal Reports?

Symptom

  • What is the number of characters limit for a Command Object?
  • The Add Command feature is used to enter a custom SQL Query for a report to execute. What is the maximum size?
  • What is the number of characters limit that can be entered for a SQL Query in a Command Object, in Crystal Reports?

Environment

  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016
  • SAP Crystal Reports 2020

Reproducing the Issue

  1. In Crystal Reports, create a new report off any relational data source.
      
  2. In the "Database Expert", under the database connection, double click on "Add Command"
       
  3. In the window "Add Command To Report", you can enter a SQL Query that will be sent to your data source.
    What is the number of characters limit that can be entered for the SQL Query in the "Add Command" window.

Resolution

  • 65,534 is the maximum number of characters that can be entered in a SQL Query, for a Command Object, in Crystal Reports.
                
  • Note: If your SQL Query is larger than 64KB, create a stored procedure in your database, then create a report based on the Stored Procedure.

Keywords

CR, Add Command , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020 ; SAP Crystal Reports, developer version for Microsoft Visual Studio ; SAP Crystal Reports, version for Visual Studio .NET 2005 ; SAP Crystal Reports, version for Visual Studio .NET 2008