Wednesday, March 28, 2012

Insert/Update too slow

Hi,

I have a table with 110 nvarchar (255) columns in the database. I receive the data from the server (array) and them loop through it to insert the data into the database. The problem is it takes more than 3 minutes to insert (or update) (in memory) the 310 records it got from the array. I am reusing the Statement (with parameters). How could I improve the performance?

It's really a small quantity of data, the CPU in the device is 520Mhz... it should be alright!

Can aynone help me please?

Thanks

You can read some performance improvement topics here:

SQL Compact Edition Insert Performance

Tuning SQL Compact Edition Insert Performance

I hope these help you get the performance you want.

|||I've recently found a great article about SQL Server CE insert performance:
http://www.pocketpcdn.com/articles/articles.php?&atb.set(a_id)=11003&atb.set(c_id)=74&atb.perform(details)=&

In brief: OLE DB is the fastest method. When you want to stick to managed code try SqlCeResultSet

|||Thanks Guys!

I'll try that!

Cheers
|||I made the changes and the improvement was about 10X... amazing!!

Also the code is much clear now.

I am using this approach (ResultSet) for Updating and Seeking records as well.

I am happy now!

No comments:

Post a Comment