How to Fix SQL Server Error 20572 (Msg 20572)
You get sql server error 20572 when a replication check fails and resets a subscriber article. To fix it, stop direct writes on the subscriber and let the fresh snapshot finish. In the database engine, message 20572 carries a severity level of 10. It states that a subscriber subscription to an article in a publication has been reinitialized after a validation failure. Because severity 10 is an informational status, the engine already started the reset action. Still, you must find out why the su
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You get sql server error 20572 when a replication check fails and resets a subscriber article. To fix it, stop direct writes on the subscriber and let the fresh snapshot finish.
In the database engine, message 20572 carries a severity level of 10. It states that a subscriber subscription to an article in a publication has been reinitialized after a validation failure. Because severity 10 is an informational status, the engine already started the reset action. Still, you must find out why the subscriber data drifted from the publisher.
What causes sql server error 20572 in replication
Replication validation compares row counts or checksums between the publisher and the subscriber. When those numbers do not match, validation fails for that specific article. If your replication setup tells the agent to reinitialize on failure, message 20572 appears in your logs.
Data drift usually happens when a person or an app writes directly to the subscriber table. Subscribers in one-way replication should only take writes from the replication agent. If an engineer logs in and edits a row, the table no longer matches the source. The next validation run spots the mismatch and flags the article for a full reload.
Network drops or partial batch failures can also leave a subscriber out of sync. Also, custom triggers on subscriber tables might alter incoming rows during replication delivery. Even a small change to a single row will break a checksum match.
How to diagnose and fix subscriber drift safely
Start by checking your replication monitor and agent logs to find the exact article name. Note the subscriber and publication names listed in the message 20572 output. Wait for the snapshot agent and distribution agent to finish applying the new data. If the table is huge, watch your network and disk load during the transfer.
Next, stop future drift by locking down user roles on the subscriber database. A database user is the identity of a login when it connects to a database. Review which users have rights to change tables on the subscriber.
Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Never give engineers or reporting apps the owner role on a read replica. Members of the database owner role can perform all maintenance tasks and can even drop the database. Also check for the data writer role, which lets users add, delete, or change data in all user tables.
Instead, put reporting users and read-only apps into the data reader role. Members of the data reader role can read all data from all user tables and views. If a login must never change rows, you can also use the deny data writer role. Members of that role cannot add, modify, or delete any table data. Keep in mind that the rights assigned to fixed database roles cannot be changed.
Preventing future validation failures in production
After you clean up database roles, check your subscriber tables for active user triggers. Make sure any local triggers do not fire when the replication agent applies rows. You should also review your scheduled jobs on the subscriber instance. Ensure no maintenance script deletes or updates rows in replicated tables.
If your team only needs access to one or a few databases, consider contained users. A contained database user has a password and is not tied to a login in master. An admin must first enable contained databases on the server and the database. Using clear user types and strict read roles stops accidental edits before they break replication.
Add runtime guardrails beside SQL Server
Role grants and network rules are needed setup for SQL Server. Still, an allowed user or agent tool can send a bad delete or read raw customer fields over a valid session. In practice, hoop.dev sits inline in the TDS protocol beside the database as a sidecar for your SQL Server. For every query an agent or human runs in production, hoop.dev decides whether to pass, mask, block, or escalate it for review.
With hoop.dev SQL Server controls, rules refuse banned statements before they run, hold risky queries for human review, and mask matched sensitive values in supported result columns in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for HIPAA, PCI DSS, SOX, and GDPR audits. See the source on GitHub.
Frequently asked questions
Does sql server error 20572 mean my replication is broken?
No, severity 10 is an informational message. It means validation failed, and the agent already triggered a reinitialization to fix the out-of-sync article.
How can I stop users from causing validation failures on a subscriber?
Remove users from the data writer and owner roles on the subscriber database. Assign them to the data reader role or the deny data writer role instead.
Why does a reinitialization hurt production database performance?
Reinitializing an article forces the engine to generate and send a fresh table snapshot. On large tables, this transfer uses heavy network bandwidth and locks subscriber resources.
Related guides
In this post