sp_article_validation (T-SQL)

Initiates a data validation request for the specified article.

Syntax

sp_article_validation [@publication =] 'publication' [,[@article =] 'article']
    [,[@rowcount_only =] rowcount_only]
    [,[@full_or_fast =] full_or_fast]
    [,[@shutdown_agent =] shutdown_agent]

Arguments
[@publication =] 'publication'
Is the name of the publication in which the article exists. publication is sysname, with no default.
[@article =]'article'
Is the name of the article to change. article is sysname, with no default.
[@rowcount_only =] rowcount_only
Is whether to return only the rowcount for the table. rowcount_only is bit,with a default of 1, which specifies rowcount only. 0 specifies rowcount and checksum.
[@full_or_fast =] full_or_fast
Is the method used to calculate the rowcount. full_or_fast is tinyint, and can be one of these values.

 

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.

[@shutdown_agent =] shutdown_agent
Is whether the Distribution agent should shut down immediately upon completion of the validation. shutdown_agent is bit, with a default of 0. If 0, the Distribution Agent does not shut down. If 1, the Distribution Agent shuts down after the article is validated.
Return Code Values

0 (success) or 1 (failure)

Remarks

sp_article_validation is used in snapshot and transactional replication.

sp_article_validation causes validation information to be gathered on the specified article and posts a validation request to the transaction log. When the Distribution Agent receives this request, the Distribution Agent compares the validation information in the request to the Subscriber table. The results of the validation are displayed in the Replication Monitor and SQL Server Agent alerts.

Permissions

Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_article_validation.

See Also
sp_publication_validation System Stored Procedures
sp_table_validation  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.