Share via

SQL Snapshot Replication Fails with BCP EOF / NULL Errors (Works in Transactional Replication)

Parag Nimbhore 5 Reputation points
2026-04-29T12:20:04.25+00:00

Issue:
We have Snapshot Replication on a production server that was working fine but recently started failing with the below error:

Agent message code 20037. The process could not bulk copy into table "XXX".

Message: End of file reached, terminator missing or field data incomplete
Message:Batch send failed

Message: Failed to send batch after max errors

More details:

Publisher & Distributor: Microsoft SQL Server 2017 (RTM-CU31-GDR) (KB5084818) - 14.0.3525.1 (X64) Standard Edition on Windows Server 2016 Datacenter

Subscriber:

  • Microsoft SQL Server 2022 (RTM-CU24-GDR) (KB5083252) - 16.0.4250.1 (X64) Standard Edition on Windows Server 2022 Datacenter
  • Microsoft SQL Server 2017 (RTM-CU31-GDR) - 14.0.3525.1 (X64) Standard Edition on Windows Server 2016 Datacenter

What we tried:

  1. Dropped table on subscriber + deleted snapshot folder + reinitialized → worked temporarily
  2. Issue reoccurred; same steps no longer fix it
  3. Created new Snapshot Replication → same failure for this table
  4. Created Transactional Replication with same table → works fine

Issue occurs only in Snapshot Replication

 

Findings:

• Suspected issue with datetime2(7) and SNAC 11.0 (BCP native mode)
• Snapshot Agent appears to generate multiple .bcp files (parallel processing)

 

Quick Solution Workaround (working):

  1. To avoid generating multiple .bcp files per table (parallel processing), we added a row filter (WHERE 1 = 1) to the affected articles.

Questions:

  1. Is this a known issue with Snapshot Replication multi-threaded BCP?
  2. Does SNAC 11.0 have limitations with datetime2(7)?
  3. As we cannot add the same filter to every table (due to scale), will upgrading to OLE DB / ODBC Driver 17 or 18 resolve this?
  4. Is there a way to disable BCP partitioning globally (without using row filters)?
SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories


1 answer

Sort by: Most helpful
  1. David Yard 0 Reputation points
    2026-06-17T14:36:15.9733333+00:00

    The WHERE 1=1 workaround confirming single-file BCP resolves it is a strong diagnostic signal — this points to a race condition or data alignment issue in parallel BCP file generation under Snapshot Replication, not a data content problem per se.

    To answer your specific questions:

    Parallel BCP partitioning — Snapshot Agent splits large articles into multiple .bcp files when MaxBcpThreads or article row counts trigger parallel processing. There is no global switch to disable this without row filters or reducing MaxBcpThreads to 1 in the Snapshot Agent profile, which is worth trying before upgrading drivers.

    SNAC 11.0 and datetime2(7) — SNAC has known limitations with high-precision temporal types in native BCP mode. This is a legitimate suspect, especially if the table recently had datetime2 columns added or populated with non-null high-precision values.

    Driver upgrade — Switching to ODBC Driver 17 or 18 is the right long-term move and has resolved similar BCP encoding issues for others. It won't disable partitioning but handles datetime2 correctly in native mode.

    Immediate thing to test — Set MaxBcpThreads = 1 in the Snapshot Agent profile for this publication and retest without the row filter. If that stabilizes it, you've isolated parallel BCP as the cause and can escalate to Microsoft with that confirmation.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.