Excel to SQL Server (SqlBulkCopy method) RRS feed

  • Question

  • Dear all,

    Does anybody have a method writing (in bulk) a named range or sheet to SQL server from Excel 2010?

    I have 100000 to 300000 records I want to write to SQL Server from an Excel model and looping through each record loaded into an array is too slow.

    Im suspecting I need to use a SqlBulkCopy method from Excel or similar but how?

    It should be something similar to this link but written in VBA code and run from the workbook:

    I can do most things in VBA but SQL or .NET is not my strong side to be modest.


    Marc Bruun

    Friday, September 30, 2011 3:27 PM


  • I looked around and didn't find a method of accessing the SqlBulkCopy class directly from Excel VBA.  I think you need to write a simple addin in Visual Studio Using David Haydens code.
    • Marked as answer by Calvin_Gao Monday, October 10, 2011 12:37 PM
    Friday, September 30, 2011 7:54 PM