none
Applying initial snapshot, primary key violation

    Question

  • Hi,

    I'm setting up transactional replication on SQL 2008 to another SQL 2008 instance.  It is a push subscription.  I've gotten two smaller databases to work, but the two large databases are giving me trouble.  There is a large table that is getting this error on the last .bcp file:

    2013-11-12 21:35:24.041 Agent message code 20037. The process could not bulk copy into table '"dbo"."FACT_TABLE"'.
    2013-11-12 21:35:24.106 Category:NULL
    Source:  Microsoft SQL Server Native Client 10.0
    Number:  
    Message: Batch send failed
    2013-11-12 21:35:24.114 Category:NULL
    Source:  Microsoft SQL Server Native Client 10.0
    Number:  2627
    Message: Violation of PRIMARY KEY constraint 'PK_FACTX'. Cannot insert duplicate key in object 'dbo.FACT_TABLE'.
    2013-11-12 21:35:24.116 Category:NULL
    Source:  Microsoft SQL Server Native Client 10.0
    Number:  20253
    Message: To obtain an error file with details on the errors encountered when initializing the subscribing table, execute the bcp command that appears below.  Consult the BOL for more information
     on the bcp utility and its supported options.
    2013-11-12 21:35:24.118 Category:NULL
    Source:  
    Number:  20253
    Message: bcp "DataWarehouseDatabase"."dbo"."FACT_TABLE" in "X:\repl\xxx\FACT_TABLE_142#48.bcp"
     -e "errorfile" -t"\n<x$3>\n" -r"\n<,@g>\n" -m10000 -DestServer -T -w

    As you can see, this is the 48th .bcp file.  1-20 or so are about 60MB, then 20-47 are 0KB.  I thought seemed odd.

    I tried to run the bcp command and get no errors, no error output to file and 0 rows copied.  

    I then ran the .pre script, and the .sch script and then tried to run the #1.bcp file - same result with 0 rows.  

    I checked the article properties to make sure it is dropping the object before creation and it seems to be set correctly.  I didn't modify anything from default settings.

    I have the same behavior for another large table in another similar database.  Any suggestions?  Thanks!!!



    Wednesday, November 13, 2013 11:48 PM

Answers

All replies