SqlBulkCopy is useful especially to import bulk data ( ~= 600,000, e.g.) records from a SQL or another source to a designated table in a SQL server.
BUT if you do this in a EntityFramework environment in .NET framework, then you might want to have this structure for faster performance.
// set db config properties to false to disable all the auto-detect and auto-validation
dbContext.Configuration.AutoDetectChangesEnabled = false;
dbContext.Configuration.ValidateOnSaveEnabled = false;
// perform bulk copy to SQL
using(SqlBulkCopy myCopy = SqlBulkCopy(sqlConnStr))
myCopy.BatchSize = 100; // row number to send to the server as a batch proc.
myCopy.WriteToServer(your data here);
// Re-set db configuration properties to true.
dbContext.Configuration.AutoDetectChangesEnabled = true;
dbContext.Configuration.ValidateOnSaveEnabled = true;
For details re how to use SqlBulkCopy, pls refer to the MSDN page link at the top of this article. Hope this helps. 🙂