469,275 Members | 1,441 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

Slow performance in SQL2005

Hi,

We have shifted one of our data processing to a new instance of SQL
2005. For this a new DB was created in SQL2005 and it is not an
upgrade of SQL200 DB.

The data processing application is a VB6 application that runs a batch
process to insert about
4.5 million records everyday in this SQL 2005 database. I am using
ADO
(ver 2.6) Connection object to execute T-SQL insert statements to
insert the 4.5 mill. records.

This same application used to insert the data in the SQL 2000
database
and used to take about 2.5 hours to do so. After moving it to SQL
2005 the performance has really detriorated and it now takes more
than
6 hours.

Is there any configuration change that I need to do in SQL 2005?
Please help.

Note: There is also an instance of SQL 2000 running in the same
server.

TIA,
Tawfiq
Feb 19 '08 #1
3 2807
On Mon, 18 Feb 2008 19:14:11 -0800 (PST), Tawfiq
<ta**************@gmail.comwrote:

I get the impression you have VB6 code that does the equivalent of:
for i = 1 to 4.5 million
insert one record
next

Isn't there a better way?

A quick-and-dirty fix may be to continue to insert these records in
your SQL2000 instance, and then bulk-insert them into the new db. But
more than likely you can use SSIS to more efficiently import your
data.

-Tom.

>Hi,

We have shifted one of our data processing to a new instance of SQL
2005. For this a new DB was created in SQL2005 and it is not an
upgrade of SQL200 DB.

The data processing application is a VB6 application that runs a batch
process to insert about
4.5 million records everyday in this SQL 2005 database. I am using
ADO
(ver 2.6) Connection object to execute T-SQL insert statements to
insert the 4.5 mill. records.

This same application used to insert the data in the SQL 2000
database
and used to take about 2.5 hours to do so. After moving it to SQL
2005 the performance has really detriorated and it now takes more
than
6 hours.

Is there any configuration change that I need to do in SQL 2005?
Please help.

Note: There is also an instance of SQL 2000 running in the same
server.

TIA,
Tawfiq
Feb 19 '08 #2
The application reads data from binary files and then inserts it into
the db.

I can improve perfomance by first writing the data first into text
files and then doing bulk insert. But why is there such a big
differnece in performce between SQL2000 vs SQL2005?

I guess some kind of configuration change is needed or maybe even I
have to rewrite the code in ADO.NET.

Anyone got any clue for such a drastic reduction in performance?

On Feb 19, 10:31*am, Tom van Stiphout <no.spam.tom7...@cox.netwrote:
On Mon, 18 Feb 2008 19:14:11 -0800 (PST), Tawfiq

<tawfiq.choudh...@gmail.comwrote:

I get the impression you have VB6 code that does the equivalent of:
for i = 1 to 4.5 million
* insert one record
next

Isn't there a better way?

A quick-and-dirty fix may be to continue to insert these records in
your SQL2000 instance, and then bulk-insert them into the new db. But
more than likely you can use SSIS to more efficiently import your
data.

-Tom.
Hi,
We have shifted one of our data processing to a new instance of SQL
2005. For this a new DB was created in SQL2005 and it is not an
upgrade of SQL200 DB.
The data processing application is a VB6 application that runs a batch
process to insert about
4.5 million records everyday in this SQL 2005 database. I am using
ADO
(ver 2.6) Connection object to execute T-SQL insert statements to
insert the 4.5 mill. records.
This same application used to insert the data in the SQL 2000
database
and used to take about 2.5 hours to do so. After moving it to SQL
2005 the performance has really detriorated and it now takes more
than
6 hours.
Is there any configuration change that I need to do in SQL 2005?
Please help.
Note: There is also an instance of SQL 2000 running in the same
server.
TIA,
Tawfiq- Hide quoted text -

- Show quoted text -
Feb 19 '08 #3
Tawfiq (ta**************@gmail.com) writes:
The application reads data from binary files and then inserts it into
the db.

I can improve perfomance by first writing the data first into text
files and then doing bulk insert. But why is there such a big
differnece in performce between SQL2000 vs SQL2005?
Without further knowledge of your situation, it's hard to tell. But
if your code looks like Tom suspected, you loop and insert one row
at a time, it could be as simple as a network issue.

If there triggers on the table, they could have a role in it as well.

In any case, 2½ hours to load 4½ rows is overly long in my opinion.
Using bulk load seems like an excellent idea. Just make sure that
you run the bulk load with constraints in force.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Feb 19 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Neil | last post: by
3 posts views Thread by jdipalmajr | last post: by
3 posts views Thread by Mario Soto | last post: by
2 posts views Thread by Jim | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.