surpavan
surpavan

Reputation: 1422

Inserting several records at once - sql

I have recently created a disk catalog program for myself, it is working fine. The problem is, when i try to index my 2 TB HDD, the time taken to write 66K rows into sql table is taking a lot of time nearing 30min.

I am using sql client (sdf is the file extension).

Also, i am using two threads to insert data simultaneous saving 50% of time.

I am using vb generated table adapters only.

Your guidance would be appreciated.

Thank you.

Upvotes: 2

Views: 438

Answers (2)

ErikEJ
ErikEJ

Reputation: 41819

have a look at my SqlCeBulkCopy sample/library: http://sqlcebulkcopy.codeplex.com

Upvotes: 0

mrK
mrK

Reputation: 2290

I don't think that adding threads is the answer because the processor has to do the same amount of work. Take a look at using a bulk insert: http://msdn.microsoft.com/en-us/library/ms188365.aspx

Upvotes: 2

Related Questions