views:

912

answers:

1

Hi,

i am new at SQLCE and using Visual Studio 2008,SQLCE 3,5.I want to know that what the best way of inserting bulk records into sqlce database?Does BULK INSERT statement work for SQLCE?I have near 45 tables and some of these tables should have large amount of data.Using command.Prepare is enough or is there more efficent and fast way?

+2  A: 

SQL CE does not have a bulk insert command. For the best raw performance opening a an updateable SqlCeResultset using a TableDirect SqlCeCommand is your fastest bet. It bypasses the query processor altogether, and is actually about as fast as directly writing to a text file.

ctacke
That is sort of funny though because the MSDN docs state that TableDirect is ONLY supposed to be used by OLEDB providers. Do as I say, not as I do..."TableDirect is only supported by the .NET Framework Data Provider for OLE DB"
Jason Short
I guess I'm glad I never read the docs then. :)
ctacke