DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 938671 - Last Review: August 1, 2007 - Revision: 1.4

On This Page

SYMPTOMS

When you configure a transactional replication that uses the -SkipErrors parameter in Microsoft SQL Server 2005, the Distribution Agent may skip some rows. This behavior causes a data inconsistency issue between the publisher and the subscribers.

Additionally, when this problem occurs, the Distribution Agent may display the following messages:
007-05-18 22:49:38.195 The process failed to complete last batch in multi-streaming mode, it has been reset to single connection mode and is retrying the operation.

007-05-18 22:49:38.273 Skipped 1 error(s) when applying transactions at the Subscriber. 007-05-18 22:49:38.367 101 transaction(s) with 100 command(s) were delivered.

007-05-18 22:49:38.477 100 transaction(s) with 100 command(s) were delivered. 007-05-18 22:49:38.570 Skipped 1 error(s) when applying transactions at the Subscriber.

007-05-18 22:49:38.664 100 transaction(s) with 100 command(s) were delivered.

RESOLUTION

The fix for this issue was first released in Cumulative Update 2. For more information about how to obtain this cumulative update package for SQL Server 2005 Service Pack 2, click the following article number to view the article in the Microsoft Knowledge Base:
936305  (http://support.microsoft.com/kb/936305/LN/ ) Cumulative update package 2 for SQL Server 2005 Service Pack 2
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2005 fix release. Microsoft recommends that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
937137  (http://support.microsoft.com/kb/937137/LN/ ) The SQL Server 2005 builds that were released after SQL Server 2005 Service Pack 2 was released
Microsoft SQL Server 2005 hotfixes are created for specific SQL Server service packs. You must apply a SQL Server 2005 Service Pack 2 hotfix to an installation of SQL Server 2005 Service Pack 2. By default, any hotfix that is provided in a SQL Server service pack is included in the next SQL Server service pack.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

By default, when the Distribution Agent encounters an error, the Distribution Agent should be stopped. If you use the –SkipErrors parameter for specific errors, the Distribution Agent skips those errors and continues to process successive transactions.

Steps to reproduce the problem

  1. Set up a replication environment. To do this, run the following scripts in SQL Query Analyzer.
    use master
    go
    exec sp_adddistributor  @distributor = @@SERVERNAME
    go
    exec sp_adddistributiondb  @database = 'distribution'
    go
    exec sp_adddistpublisher  @publisher = @@SERVERNAME, @distribution_db = 'distribution'
    go
    exec sp_replicationdboption pubdb, publish, false
    go
    exec sp_replicationdboption subdb, publish, false
    go
    if db_id('pubdb') is not null
        drop database pubdb
    go
    create database pubdb
    go
    if db_id('subdb') is not null
        drop database subdb 
    go
    create database subdb
    go
    exec sp_replicationdboption pubdb, publish, true
    go
    use pubdb
    go
    create table t(c1 int primary key, c2 int, c3 sysname null, c4 nchar(200) default 'a')
    go
    create unique index c2_idx on t(c2)
    go
    sp_addpublication @publication = 'p1', @status = 'active'
    go
    sp_addarticle @publication = 'p1', @article = 'a1', @source_table = 't', @schema_option = 0x00000000000300f3
    go
    sp_addsubscription @publication = 'p1', @article = 'all', @subscriber = @@servername, @destination_db = 'subdb'
    go
    
  2. Save the following command as a batch file, and then run the file to insert data.
    c: pushd "c:\program files\microsoft sql server\90\com\" del dist.out
    call snapshot.exe -publisher %COMPUTERNAME% -publisherdb pubdb -distributor %COMPUTERNAME% -distributorsecuritymode 1 -publication p1
    call logread.exe -publisher %COMPUTERNAME% -publisherdb pubdb -distributor %COMPUTERNAME% -distributorsecuritymode 1 
    call distrib.exe -publisher %COMPUTERNAME% -publisherdb pubdb -distributor %COMPUTERNAME% -distributorsecuritymode 1 -publication p1 -subscriber %COMPUTERNAME% -subscriberdb subdb 
    start cmd.exe /s /k "logread.exe -publisher %COMPUTERNAME% -publisherdb pubdb -distributor %COMPUTERNAME% -distributorsecuritymode 1 -continuous"
    start cmd.exe /s /k "distrib.exe -publisher %COMPUTERNAME% -publisherdb pubdb -distributor %COMPUTERNAME% -distributorsecuritymode 1 -publication p1 -subscriber %COMPUTERNAME% -subscriberdb subdb -subscriptionstreams 8 -SkipErrors 2601:2627 -Output dist.out -OutputVerboseLevel 2 -continuous"
    popd
    osql -E -S[SQL_server] -Q"insert subdb..t (c1, c2) values (1000, 1000)"
    osql -E -S[SQL_server] -Q"insert subdb..t (c1, c2) values (2500, 1015)"
    osql -E -S[SQL_server] -Q"begin tran declare @v int select @v = 1 while (@v < 1020) begin insert pubdb..t (c1, c2) values (@v, @v) select @v = @v + 1 end commit tran"
    osql -E -S[SQL_server] -Q"declare @v int select @v = 3100 while (@v < 3500) begin insert pubdb..t (c1, c2) values (@v, @v) select @v = @v + 1 waitfor delay '0:0:0.10' end"
    
    Note The placeholder SQL_server represents the name of the instance of SQL Server.
  3. Notice that the data has not been replicated to the Subscriber database.

APPLIES TO
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Standard X64 Edition
  • Microsoft SQL Server 2005 Enterprise X64 Edition
  • Microsoft SQL Server 2005 Standard Edition for Itanium-based Systems
  • Microsoft SQL Server 2005 Enterprise Edition for Itanium-based Systems
Keywords: 
kbexpertiseinter kbqfe KB938671
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support