Initiates an article validation request for each article in the specified publication.
sp_publication_validation [@publication =] 'publication'
[,[@rowcount_only =] rowcount_only]
[,[@full_or_fast =] full_or_fast]
[,[@shutdown_agent =] shutdown_agent]
Value | Description |
---|---|
0 | Does full count using COUNT(*). |
1 | Does fast count from sysindexes.rows. Counting rows in sysindexes is much faster than counting rows in the actual table. However, because sysindexes is lazily updated, the rowcount may not be accurate. |
2 (default) | Does conditional fast counting by first trying the fast method. If fast method shows differences, reverts to full method. If expected_rowcount is NULL and the stored procedure is being used to get the value, a full COUNT(*) is always used. |
0 (success) or 1 (failure)
sp_publication_validation is used in snapshot and transactional replication.
sp_publication_validation can be called at any time after the articles associated with the publication have been activated. The procedure can be run manually one time or as part of a regularly scheduled job that validates the data.
If your application has immediate-updating Subscribers, sp_publication_validation may detect spurious errors. sp_publication_validation first calculates the rowcount or checksum at the Publisher and then at the Subscriber. Because the immediate-updating trigger could propogate an update from the Subscriber to the Publisher after the rowcount or checksum is completed at the Publisher but before the rowcount or checksum is completed at the Subscriber, the values could not change. To ensure that the values at the Subscriber and Publisher do not change while validating a publication, stop the MSDTC service at the Publisher during validation.
Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_publication_validation.
sp_article_validation | System Stored Procedures |
sp_table_validation |