Large Flat File database import using SqlBulkcopy

Discussion in 'ASP.NET 2.0' started by bobsandberg, Jun 8, 2007.

  1. My web app has the need to upload a large flat data file for importation into the database on a weekly basis. The upload is user driven, so I have a file upload page to upload the file and import it into the database.

    I am having trouble with the import process.

    I first tried to use System.Data.SqlClient.SqlBulkCopy class

    This worked great on my dev machine, but when I ran it on the discountAsp server, I received a permission error Sql exception.

    I reimplemented with some batched inserts, but this takes 5 to 10 minutes to import 50,000 rows of data, where as it was a minute or two with SqlBulkCopy.

    If anyone has used SqlBulkCopy class, please let me know if you did anything special to not have database permission problems.

    If anyone has another large file import method, I'd be very interested in seeing it.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

Share This Page