Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

SQL Server Error 1537: Cannot Suspend a Sort That Is Not

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Error 1537 (“Cannot suspend a sort that is not running”) is an internal SQL Server engine message that appears when a query tries to pause a sort operation that has already finished, was never started, or was cancelled. It is not something you fix with a single setting; you resolve it by identifying the query that triggers it, correcting the query plan or the client behaviour behind it, and applying the current cumulative update for your SQL Server version. You need access to the SQL Server error log, permission to run a Profiler or Extended Events trace, and a maintenance window to apply updates.

What You'll Need

  • Administrative access to the SQL Server instance (sysadmin or equivalent) to read the error log and run traces.
  • SQL Server Management Studio (SSMS) or Azure Data Studio connected to the instance.
  • The exact time the error occurred, so you can match it to a query in a trace or the error log.
  • Permission to install the latest cumulative update for your SQL Server build, and a maintenance window in which to do it.
  • If the error comes from an application, the application owner or developer available to review the query and connection settings.

Step-by-Step

  1. Confirm the error and its context. Open SSMS, connect to the instance, and run EXEC sp_readerrorlog; to read the current error log. Search for message 1537 and note the timestamp, the database, and any session or SPID information logged around it. If the message only appears in the application's error handling and not in the SQL Server log, treat it as a client-side symptom and continue with the trace step.
  2. Capture the query that triggers it. Start an Extended Events session or a server-side trace filtered on the error number and the time window you identified. The goal is to see which statement, stored procedure, or batch was running when 1537 was raised. If you cannot run a trace, enable DBCC TRACEON (1222) temporarily to capture blocking and deadlock detail, then turn it off with DBCC TRACEOFF (1222).
  3. Reproduce the failure in isolation. Run the captured statement in SSMS against a copy of the database, or in a transaction you can roll back. If the error reproduces, you have isolated the query. If it does not, the trigger is likely concurrency, a cancelled client request, or a plan that changes under load.
  4. Check the query plan for sort operators. In SSMS, enable “Include Actual Execution Plan” and run the statement. Look for Sort operators, especially ones feeding a TOP, MERGE JOIN, or window function. A sort that is repeatedly started and stopped, or one that is cancelled mid-flight, is the usual source of this message.
  5. Rewrite or re-index to remove the unstable sort. Add or adjust an index so the sort can be satisfied by index order, replace SELECT DISTINCT with a GROUP BY on the needed columns, or move a window function into a subquery. Update statistics with UPDATE STATISTICS on the affected tables so the optimizer has current cardinality estimates.
  6. Check client cancellation and timeouts. If the application cancels queries (command timeout, user navigation, connection pool recycling), a sort can be interrupted while running. Raise the command timeout in the connection string or application code where appropriate, and make sure the client is not issuing a cancel immediately after the query starts.
  7. Apply the latest cumulative update. Compare your build number (run SELECT @@VERSION;) with the current cumulative update for your SQL Server version on Microsoft's official download pages. Error 1537 has been addressed in engine fixes over time; installing the latest cumulative update for your version is the supported remedy. Test in a non-production environment first.
  8. Monitor after the change. Re-run the Extended Events session for a few days, filtered on error 1537. If the message no longer appears, close the incident. If it returns, capture the new query and repeat from step 3.

Common Mistakes

  • Treating 1537 as a configuration error and changing server settings. It is a query-execution symptom, not a server option.
  • Restarting the SQL Server service as a first response. A restart clears the plan cache and hides the evidence you need.
  • Applying a cumulative update to production without testing it against the workload that triggered the error.
  • Ignoring client-side cancellation. Many reports of this message trace back to an application that cancels queries on a short timeout.
  • Editing the query without updating statistics, so the optimizer keeps choosing the same unstable plan.

Tips

  • Record the exact build number before and after any update so you can correlate behaviour with the patch level.
  • Use Extended Events rather than the deprecated SQL Trace for new captures; the event data is richer and easier to filter.
  • Keep a copy of the actual execution plan (Save As .sqlplan) alongside the incident notes; plans change as data grows.
  • If the error appears only under load, test with concurrent sessions rather than a single query in SSMS.

Troubleshooting

If the error persists after the steps above, work through these checks in order, simplest first.

  • The trace shows no query. The error may be raised by a background task or an internal operation. Check the SQL Server error log around the timestamp and confirm the instance is on a supported build.
  • The query runs fine in SSMS but fails in the application. Compare connection settings: command timeout, SET options, and whether the client uses MARS. Differences in these can change the plan.
  • The plan changes after the update. Clear the plan cache for the affected procedure with sp_recompile on the procedure, then re-test. Do not clear the entire plan cache on a busy server during peak hours.
  • The error returns after a few days. Data growth may have pushed the optimizer to a different plan. Re-check statistics and index fragmentation, and consider a plan guide only if you can test it thoroughly.
  • You cannot reproduce it at all. Capture for longer with Extended Events, including the error_reported event, and involve the application owner to identify the exact user action that precedes the message.

Frequently Asked Questions

Is SQL Server error 1537 dangerous?

No. It is an internal engine message indicating a sort operation could not be suspended. The query may fail or return incomplete results, but the database is not corrupted.

Does error 1537 mean my database is damaged?

No. Run DBCC CHECKDB if you want confirmation, but 1537 is an execution-plan and query-lifecycle issue, not a storage-integrity error.

Can I fix it by restarting SQL Server?

A restart may make the message disappear temporarily by clearing the plan cache, but it does not fix the underlying query or client behaviour, so the error usually returns.

Which cumulative update fixes error 1537?

There is no single update number that applies to every version. Check your build with SELECT @@VERSION; and install the latest cumulative update for your SQL Server version from Microsoft's official site.

Will this error appear in the SQL Server error log?

Sometimes. It may be logged as an error or only surfaced to the client application. If the log is empty, use an Extended Events session filtered on the error to capture it.

Do I need to change my application code?

Only if the trace shows the client cancelling queries or using a very short command timeout. Otherwise the fix is usually on the query, index, or patch side.