Bulk Insertion in SQL Server CE

I am new to SQL Server CE and use Visual Studio 2008, SQL Server CE 3.5. I want to know what is the best way to insert bulk records into a SQL Server CE database? BULK INSERT work for SQL Server CE? I have almost 45 tables, and some of these tables should have a lot of data. Is using command.Prepare sufficient or is there a more efficient and faster way?

+5
sql-server sql-server-ce
source share
2 answers

SQL CE does not have a built-in insert command. To get the best initial performance, the updated SqlCeResultset opens with TableDirect. SqlCeCommand is your fastest bet. It bypasses the query processor as a whole and is actually about as fast as direct writing to a text file.

+13
source share

I wrapped the bulk insert code in the NuGet library, which you can use as you use SqlBulkCopy today: http://sqlcebulkcopy.codeplex.com p>

+10
source share

All Articles