all groups > sql server msde > july 2007 >
You're in the

sql server msde

group:

Slow performance in adding records to msde table imported from dbase.


Slow performance in adding records to msde table imported from dbase. CharlesC
7/19/2007 10:14:04 AM
sql server msde:
Hello,

I imported dbf files (dbase) into an msde database.

I see the tables with the data in the msde database. The data is identical.

The only change made to the code is in the DSN assignment in the Recordset's
GetDefaultConnect(),
return _T("ODBC;DSN=themsde").

Both DSN's are ODBC, the original uses Microsoft dBase driver (dbf),
the msde is of course SQL Server.

Using the SAME data and the SAME code I add a record (AddNew())
the Recordset.Open() takes about 4 or 5 times longer with the msde dsn
the Recordset.Update() takes about 10 times longer (eg. 10 seconds with the
msde dsn, less than 1 with dbase odbc dsn)

Are there changes that have to be made in the code or in the data?

Thanks.

Re: Slow performance in adding records to msde table imported from dbase. JPD
7/20/2007 12:00:00 AM
Hi Charles,

Rather than focusing on the change in DSNs I think you should focus on a
much more fundamental change namely the fact that you have changed the
RDBMS. I would start by adding a few relevant indexes to your tables
and if they already exist try updating your statistics.

Jonathan



[quoted text, click to view]
Re: Slow performance in adding records to msde table imported from dbase. CharlesC
9/20/2007 12:00:00 AM
Differences between odbc dbase and sql required adjustments to table design
and filters.
Thanks anyway.

[quoted text, click to view]

Re: Slow performance in adding records to msde table imported from dbase. William Vaughn
9/20/2007 10:40:35 AM
Ah, using a Recordset or any ADO classic method to add bulk rows to a SQL
Server table will result in terrible performance. The correct approach when
importing data is to use SSIS, DTS, Bulk Copy or the TSQL bulk copy methods.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

[quoted text, click to view]
Re: Slow performance in adding records to msde table imported from dbase. CharlesC
9/20/2007 5:18:38 PM
But that is not what I was doing, the data had already been imported.
Thanks.

[quoted text, click to view]

Re: Slow performance in adding records to msde table imported from dbase. William Vaughn
9/20/2007 6:27:48 PM
So, with the ADO.NET 2.0 SqlBulkCopy method you can take an existing array,
DataTable or DataReader and export directly to SQL Server. This technique
can move many hundreds of thousands or rows in no time. Even if you can't
use ADO.NET, you can use any version of any language to write a delimited
file. The BCP command-line utility can read this and import the data.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

[quoted text, click to view]
AddThis Social Bookmark Button