ethem
ethem

Reputation: 2918

how to insert multiple rows/bulk records in MS SQL CE database with SQL insert statement?

I like to insert Multiple records (bulk insert) in MS SQL CE. I can access my CE (*.sdf) database via VS 2010 studio.

I googled and found the link below for the bulk insert syntax. Inserting multiple rows in a single SQL query?

I prepared following syntax (just showing 3 records now) :

INSERT INTO CompteGenerals

(Company, LineId, Account, Description1, Description2)

VALUES (999999, 1, N'4000', N'Clients', N'Klanten')

,VALUES (999999, 2, N'4400', N'Fournisseurs', N'Leveranciers')

,VALUES (999999, 3, N'4510', N'TVA à payer', N'Verschuldigde BTW')

but how can I insert my bulk records? (since the SQL CE database is re-created regularly (development), I don't want to add all records manually)

please advice.

Upvotes: 0

Views: 5305

Answers (1)

ErikEJ
ErikEJ

Reputation: 41799

That syntax is not supported with SQL Server Compact. But you can bypass the Query processor to do very fast INSERTs, my SqlCeBulkCopy library simplifies that, available at http://sqlcebulkcopy.codeplex.com

Upvotes: 2

Related Questions