What’s the fastest way to bulk insert a lot of data in SQL Server (C# client)

Here’s how you can disable/enable indexes in SQL Server:

--Disable Index ALTER INDEX [IX_Users_UserID] SalesDB.Users DISABLE
--Enable Index ALTER INDEX [IX_Users_UserID] SalesDB.Users REBUILD

Here are some resources to help you find a solution:

Some bulk loading speed comparisons

Use SqlBulkCopy to Quickly Load Data from your Client to SQL Server

Optimizing Bulk Copy Performance

Definitely look into NOCHECK and TABLOCK options:

Table Hints (Transact-SQL)

INSERT (Transact-SQL)

Leave a Comment