Resource / capacity
SQL error 8657: could not get the memory grant
Power BI dataset refresh error: what it means and how to fix it.
What this means
The source SQL engine refused the query's memory grant: the request needed more query workspace memory than its workload group's per-request ceiling allows.
How to fix it
- Lower the memory the query asks for: return fewer columns and filter rows down before any sort or hash, since those are the operators that need workspace memory.
- Do not just retry. The engine already tries reducing the degree of parallelism, down to DOP 1, before it gives up, so the same query asks for the same grant again.
- Where you control the server, REQUEST_MAX_MEMORY_GRANT_PERCENT on the workload group is the setting that defines the ceiling. On a managed endpoint it is not yours to change, so the query shape is the only lever.
Frequently asked questions
- What does the "SQL error 8657: could not get the memory grant" error mean?
- The source SQL engine refused the query's memory grant: the request needed more query workspace memory than its workload group's per-request ceiling allows.
- How do I fix it?
- Lower the memory the query asks for: return fewer columns and filter rows down before any sort or hash, since those are the operators that need workspace memory. Do not just retry. The engine already tries reducing the degree of parallelism, down to DOP 1, before it gives up, so the same query asks for the same grant again. Where you control the server, REQUEST_MAX_MEMORY_GRANT_PERCENT on the workload group is the setting that defines the ceiling. On a managed endpoint it is not yours to change, so the query shape is the only lever.
- Where does this Power BI refresh error appear?
- It appears in a Power BI semantic model's refresh history when a scheduled or on-demand refresh fails.
Related resource / capacity errors
Catch this automatically
RefreshRadar monitors every Power BI dataset refresh and emails you when one fails, with the likely cause and the fix, so you are not hearing about a broken refresh from your stakeholders first.