BCP commands used by Replication Snapshot generation and apply


  • Hello Gurus,

    I understand replication internally uses the BCP commands to extract data out of a table and again uses BCP or Bulk Insert to put it in the subscriber table. 
    If somebody has the sample of these commands saved, please provide me with those. 

    Thanks in advance. 
    Tuesday, June 17, 2014 3:46 AM


All replies

  • refer the below link

    pls mark as answer if this helpful to you

    Wednesday, June 18, 2014 2:48 PM
  • If you have replication configured then you can take a look at the snapshot folder for the .bcp files

    Regards, Ashwin Menon My Blog - http:\\

    Wednesday, June 18, 2014 3:20 PM
  • snapshot folder as per my understanding contains the pre schema, schema and bcp file with data only.
    It doesnot contain the scripts which will be run the pump in the data or extract the data from the tables. 

    Wednesday, June 18, 2014 5:38 PM
  • Yes, you are right. It doesn't contain the script but distribution agent refers the synchronization set(sch, bcp) to publish the data over to the subscribers.

    Replication uses various types of files such as SCH which holds the schema and bcp for bulk copy of data, trg triggers,idx for indexes and dri for constraints and indexes,cab for compressed snapshot files for its internal purpose.

    You can't view or modify these objects per my knowledge, 

    We can Only customize and modify internal stored procedures(sp_MsIns, MsUpd,MsDel)


    Wednesday, June 18, 2014 6:24 PM
  • Hilary has a good reply in this thread which indicates that the bcp operation is done by a dll called odbcbcp.dll:

    That is not them - they will look like this:

    sync -t"textdb" -o"dbo" -d"c:\temp\unc\WINDOWS7_TEXTDB_TEST\20120127080002\textdb_2.bcp" -V80 -hORDER([PK] ASC)

    The bcp operation is done by a dll called odbcbcp.dll

    The commands are not 100 % symmetric with bcp but close enough.

    Brandon Williams (blog | linkedin)

    Wednesday, June 18, 2014 7:31 PM
  • He also touches on the odbcbcp.dll in his very old but still relevant replication book.

    Brandon Williams (blog | linkedin)

    Wednesday, June 18, 2014 7:35 PM