How to fix Error 10763 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 10763

Why This Error Happens

Error 10763 occurs when a GROUP BY clause in a Transact-SQL query contains more than one query hint, such as combining WITH ROLLUP, WITH CUBE, or GROUPING SETS syntax incorrectly, or duplicating the same hint multiple times. SQL Server 2025’s query parser strictly enforces that only a single grouping hint can be applied per GROUP BY clause to maintain unambiguous execution plan generation. This is typically a T-SQL syntax issue introduced during manual query edits, ORM-generated queries, or migration scripts rather than a server configuration or permissions problem.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Open SQL Server Management Studio (SSMS) 21 or Azure Data Studio connected to your Windows Server 2025 instance.
  • Check the SQL Server Error Log via Object Explorer > Management > SQL Server Logs or query sys.messages for Error 10763 context.
  • Locate the exact stored procedure, view, or ad-hoc query referenced in the error output pane.

Step 2: Review and Isolate the GROUP BY Hints

  • Open the query text and locate the GROUP BY clause.
  • Look for multiple occurrences of hints like:
  GROUP BY column1 WITH ROLLUP, column2 WITH CUBE
  • Confirm whether GROUPING SETS, ROLLUP, or CUBE are being combined incorrectly in the same clause.

Step 3: Remove Duplicate or Conflicting Hints

  • Rewrite the query to include only one hint type per GROUP BY clause:
  GROUP BY GROUPING SETS ((column1), (column2))
  • If both rollup and cube behavior are needed, restructure using UNION ALL with separate GROUP BY statements instead of combining hints.
  • Save the corrected script to C:\Scripts\SQLFixes\ for version tracking before re-deployment.

Step 4: Validate Application and ORM-Generated Queries

  • If the query originates from an application (e.g., Entity Framework, Dapper, or a reporting tool), check the generated SQL in the application logs located typically at C:\inetpub\wwwroot\<App>\Logs\ on Windows Server 2025.
  • Update the LINQ or query-builder logic to avoid stacking multiple grouping hints in a single aggregation call.

Step 5: Re-run and Deploy the Corrected Query

  • Execute the revised query in SSMS to confirm successful execution without Error 10763.
  • Redeploy the updated stored procedure or view to the production database using sqlcmd or a deployment pipeline:
  sqlcmd -S ServerName -d DatabaseName -i C:\Scripts\SQLFixes\fixed_query.sql

Alternative or Verification Steps

  • Run the corrected query directly in SSMS and confirm the execution plan generates without syntax errors; check Messages tab for confirmation of row counts returned.
  • If the error persists, use SET SHOWPLAN_TEXT ON before executing the query to inspect how SQL Server parses the GROUP BY clause and pinpoint any remaining hint conflicts.