How to Fix SQL Server Error 20574 (Msg 20574)
You get sql server error 20574 when a subscriber fails a replication data check. You fix it by finding the mismatched rows and syncing the target table. The database engine logs this event with a severity level of ten. The official message states that a subscriber subscription to an article failed data validation. It names the specific subscriber, article, and publication involved in the failure. This alert means the data on the subscriber does not match the publisher. What causes sql server
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 20574 when a subscriber fails a replication data check. You fix it by finding the mismatched rows and syncing the target table.
The database engine logs this event with a severity level of ten. The official message states that a subscriber subscription to an article failed data validation. It names the specific subscriber, article, and publication involved in the failure. This alert means the data on the subscriber does not match the publisher.
What causes sql server error 20574 in replication
Replication expects the target table to mirror the source table at all times. When you run a validation check, the engine compares row counts or checksums. If those numbers differ between the two servers, the engine raises message 20574. Because severity ten is an informational status, replication agents often keep running anyway. Still, the underlying data drift still puts your reporting and backups at risk.
Direct writes on the subscriber are the most common cause of this drift. A user or an app logs in to the subscriber and changes rows. Even a small update or an extra row breaks the validation check. Failed replication scripts or skipped errors can also leave a subscriber behind. Network drops during large batch transfers can delay updates and trigger false alarms.
Too many users hold broad write roles on read-only replica databases. For instance, someone might assign the fixed database role for writing data to a user. Members of that role can add, delete, or change data in all user tables. Worse, some teams grant the database owner role for quick debugging work. A database owner can perform all maintenance tasks and even drop the database.
How to diagnose and fix subscriber data drift
Start by reading the exact error text in your replication log viewer. Note the subscriber name, the publication name, and the specific article that failed. Wait for a quiet period before you re-run the validation check. If the error clears on its own, replication lag caused the first alert. If the error stays, you have real data drift on the target table.
To inspect the drift safely, use a read-only database user account. Members of the fixed read role can read all data from user tables. You cannot change the permissions assigned to fixed database roles on the server. Compare the row counts and recent timestamps between the publisher and subscriber tables. Look for missing primary keys or extra rows added outside the replication stream.
Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Once you find the bad rows, you have two ways to fix them. For a small table, you can reinitialize the subscription to push fresh data. For a huge table, you can repair the specific mismatched rows by hand. Only grant write rights to the repair account for the time needed. When the fix is done, run the validation check again to confirm success.
How to prevent future validation failures
Lock down user roles on all subscriber databases to stop manual edits. A database user is the identity of a login when it connects. If a user needs access to many databases, use a login in master. For access to one or a few databases, consider a contained database user. An admin must first enable contained databases on the server and the database.
Remove regular users and reporting apps from any roles that allow data writes. You can also use the fixed deny data writer role to block changes. Members of that deny role cannot add, modify, or delete any table data. Keep human engineers out of shared admin accounts during daily database checks. Mask sensitive fields like emails, phone numbers, card numbers, and national IDs in results.
Check SQL Server batches and results on the wire
SQL Server logins and roles decide who connects. They do not check what each TDS batch does or mask sensitive values in returned rows. With hoop.dev, you run an open-source proxy, a sidecar for your SQL Server, inline in the TDS wire protocol. On every batch an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.
Before a batch hits the server, hoop.dev guardrails refuse disallowed actions with a native TDS error or hold risky statements for approval. On the way back, hoop.dev data masking rewrites sensitive values in supported result columns in memory, and every decision is logged. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Does message 20574 stop the replication agent from running?
No, this message has a severity of ten, which is an informational alert. The agent logs the validation failure and continues processing other queued changes.
How do I stop users from changing data on a subscriber?
Give reporting users the fixed read role so they only read user tables. You can also add them to the deny write role to block edits.
Should I reinitialize the whole publication to fix one article?
No, the error message names the single article that failed the data check. You only need to sync or repair the data for that specific table.
Related guides
In this post