Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 24th, 2006, 06:39 AM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Timeout Expired Error

While inserting huge amount of data into a table, sometimes I get this error message 'Timeout Expired' and my program stops.

But the same program runs well sometime later.

It is a simple insert query executed as many times as there are rows to be inserted.

Can anyone help me to understand this error please?

Thanks,
Bala.

 
Old July 24th, 2006, 07:08 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How do you indert the data? Try to increase the CommandTimeout property to a longer time period.

 
Old July 27th, 2006, 02:35 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

when you do web based code the web server has a set amount of time to complete the execution of the code by. Say its five seconds. Well one time when your server is not heavily loaded like when your developing five seconds is more than enough. But when you have a table lock or a heavily loaded server or a list of other reasons that can cause your web server to run slower than normal. Your code may not execute in the 5 seconds that it's allotted. There are several ways to reduce the likelyhood of this. Stronger server is one, better internet connection another but generally the best solution is to keep the data on your individual pages small and not complicated and insure all your sql queries use indexes and don't return very much data. The most frequent time I see this is say for exmple on an order page. When there are 20 orders its not a problem but when you get to 5,000 orders it becomes a problem. The way to do this is to give pages of info at a time. Say only 50 rows of the 5,000 orders. Then require the user to request the next page of data, then the next, and the next, etc.


 
Old July 28th, 2006, 01:35 AM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the responses.

Yes, indeed I have now found that this has been happening whenever there are network connectivity issues (like too much of trafic on the network etc..) which actually slow down the connection to the database each time my query runs.

And when there are more rows inserted during these periods, I think it tis timed out.

I have even tried increasing the timeout setting. But I think the root cause is still the network connection to the server.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Login Timeout Expired error smnel ASP.NET 2.0 Basics 0 May 7th, 2008 06:58 AM
Error:-2147217871 Timeout expired sgsandeep SQL Server 2000 11 November 20th, 2007 08:49 PM
Timeout Expired Error dhara_adh SQL Server 2000 4 December 22nd, 2006 04:18 PM
Timeout Expired Error nikotromus SQL Server 2000 16 December 5th, 2006 03:54 PM
Timeout Expired Error vinod_pawar1 SQL Server 2000 5 July 17th, 2004 09:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.