Share via

how to fix error 1205 on mssql 2022

Luca Benedetto 20 Reputation points
2026-02-23T19:02:26.01+00:00

Riscontro vari errori 1205 nei log e dopo alcuni di questi, si verifica l'errore 824

SQL Server | SQL Server Transact-SQL
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 133.1K Reputation points MVP Volunteer Moderator
    2026-02-23T22:18:14.8166667+00:00

    1205 e 824 sono due errori molto differente.

    1205 è deadlock, e por risolvare un deadlock, bisogna por il primo analisare il deadlock XML. In fatto, ho un presentazione de questo sogetto, e possible di vedere a YouTube: https://www.youtube.com/watch?v=jZW4_MLLRdM

    824 al altra parte indica un problema con la sistema de I\O. Es una problema critica, e bisogna di fare DBCC CHECK, e fare investigazione del hardware. Se è possible, transferare il baso de dato a un altra server.

    .................................................

    1205 and 824 are two very different errors.

    1205 is deadlock, and to resolve a deadlock, you must first analyse the deadlock XML. As it happens, I have a presentation on this very topic that you can watch on YouTube: https://www.youtube.com/watch?v=jZW4_MLLRdM.

    824, on the other hand, indicate serious problems with your I/O subsystem. It's a critical issue, and you should run DBCC CHECKDB to see if the database is OK, and if not restore from a clean backup. Preferably, you should restore the database to another server, since corruption is likely to come back.


  2. Q&A Assist
    2026-02-23T19:02:37.2266667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To fix error 1205 in SQL Server, which indicates a deadlock situation, you can follow these steps:

    1. Identify Deadlocks: Enable trace flag 1222 to log deadlock information into the SQL Server Error Log. This will help you understand which processes are involved in the deadlock.
    2. Check Row Count: The MSreplication_subscriptions system table may have a high row count, potentially leading to deadlocks. You can check the row count using SQL Server Management Studio or by running the following query:
         SELECT rows, * FROM sys.partitions WHERE object_id = object_id('MSreplication_subscriptions')
      
    3. Optimize Transactions: Review your transactions to ensure they are as short as possible. Long-running transactions are more likely to cause deadlocks.
    4. Adjust Distribution Agents: If you have multiple publishers replicating to the same subscriber database, consider adjusting the frequency of the distribution agents to reduce contention.
    5. Monitor and Tune Queries: Analyze the queries involved in the deadlock and optimize them for performance. This may involve adding indexes or rewriting queries to reduce locking.
    6. Implement Retry Logic: Since deadlocks are sometimes unavoidable, implement retry logic in your application to handle deadlock errors gracefully.

    If you are also encountering error 824 after these deadlocks, it indicates a logical consistency-based I/O error. You should perform a consistency check using the DBCC CHECKDB command and follow the recommended resolutions for error 824.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.