SqlBulkCopy and Native Format RRS feed

  • Question

  • SqlBulkCopy is supposed to be the replacement for DMO BulkCopy class. However, it seems only distantly related to the way BCP works, so I'm wondering if I'm barking up the wrong tree. Strangely, it takes a DataReader as input rather than a file with the usual BCP options, and doesn't do export at all.

    My first question is how you set up the DataReader to deal with native format. I can't really see how the OleDb text driver can even read a file in native format.

    My second question is, is there any complete formal documentation of native format? The SQL Books Online doc is fairly superficial. I mean complete enough so I can write code to export in native format, because SqlBulkCopy only is missing the export part.

    • Moved by Larcolais Gong Thursday, March 24, 2011 3:33 PM (From:Visual C# General)
    Wednesday, March 23, 2011 8:01 PM


  • No SqlBulkCopy was not designed as a managed code replacement for the BCP utility. It simply provides a bulk/batch method for copying data to SQL Server from just about any data source. It works with native data sources through native .NET, OLEDB or ODBC Providers, which is part of the fundamental architecture of ADO.NET.

    If you want to work directly with native format SQL Server files then continue to use BCP instead.

    Paul ~~~~ Microsoft MVP (Visual Basic)
    Friday, March 25, 2011 1:25 PM

All replies