Solved

Microsoft OLE DB Provider for SQL Server error '80040e31'  - Timeout expired

Posted on 2008-06-16
21
1,153 Views
Last Modified: 2008-06-16
Hi, all,
We have a website created using ASP, it works perfect.
But sometimes we will get the error message like the following when we try to update table:

Microsoft OLE DB Provider for SQL Server error '80040e31'

Timeout expired

/Inspection/Reports/PlatformInspection/AnnualInspectionUpdateActions.asp, line 729

I must make it clear there is nothing to do with code error or connection error, it mostly works fine.

Are there some tables blocked?  How to check it? What will I do to make the website works?

Urgent!!!!!!

Thanks!

LT



0
Comment
Question by:atkinsHOU
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 12
  • 9
21 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21796828
could you post the relevant code, and the table structure + indexes involved, please?
0
 

Author Comment

by:atkinsHOU
ID: 21797023
Thank you Angel for your reply.
I think there is no code error, we have this website years, it works fine, I test it this mooring, it also works fine. And all the pages related to Insert clause have this error.
Do you think it is possble that some client failed some transaction and cause table be blocked?
How do I check it? restart server can solve this issue?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21797258
I think rather that despite the application "running fine" most of the time, the problem is that the database is not "tuned" for the amount of data you have meanwhile in the database...
hence making the queries more and more slower, and eventually taker longer than the default 30 seconds of timeout.

the first thing to check now is the sql server settings: max memory, parallelism, indexes on the tables, transaction log configs, ERRORLOG config/rollover, just to name the most important...
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

Author Comment

by:atkinsHOU
ID: 21797324
I open the table in database and try to run the following codes
UPDATE    tblPAssessmentReport
SET              R = '2'
WHERE     (PName = 'AAAA')

I also get the "Timeout Expired" message.
0
 

Author Comment

by:atkinsHOU
ID: 21797345
I am using SQL Server 2005, where can I find the ERRORLOG file?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21797367
is there an index on the field PName ?
0
 

Author Comment

by:atkinsHOU
ID: 21797373
No
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 21797384
then, please add such an index, and try to update again, and compare then the time to run the UPDATE :)
0
 

Author Comment

by:atkinsHOU
ID: 21797402
would you please tell me how to add an index?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21797413
with SQL:


CREATE INDEX idx_PAssessmentReport_Pname ON tblPAssessmentReport (PName )
 
you create that index once, and the queries should then take it into account "on the fly". 

Open in new window

0
 

Author Comment

by:atkinsHOU
ID: 21797499
Ok the index is created, what will I do to it?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21797526
nothing. just run the UPDATE query and check out the difference the existence of the index will make to it.
0
 

Author Comment

by:atkinsHOU
ID: 21797596
Our website works fine now, the update in all the pages work,I don't know what happen.  
0
 

Author Comment

by:atkinsHOU
ID: 21797641
Hi, Angel, can you tell me why? is it because I create an index in one table?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21797651
it's the index. see:
without the index, for your update, it will have to scan the entire table
 -> it's like you had to find a certain word in a 300-page-book, without the glossary/index in the end of the book: you have to read all the pages.
 with the index, it will just scan the index (few pages), find where the word is located (on which page), and can jump directly to that page.
0
 

Author Comment

by:atkinsHOU
ID: 21797674
But Angel, the table that I add index is not the page I update to, that make me confused.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21797690
your UPDATE code was this:
UPDATE    tblPAssessmentReport SET              R = '2' WHERE     (PName = 'AAAA')
and the index created was for that table:
CREATE INDEX idx_PAssessmentReport_Pname ON tblPAssessmentReport (PName )

now, you might have other tables/updates without indexes, you can "repeat" the same method (just change the index, table and column names as needed).
0
 

Author Comment

by:atkinsHOU
ID: 21797723
No, I create an index for a testing table named "tblTestTable", because I don't want to messup the current used table:
CREATE INDEX idx_tblTestTable_Pname ON tblTestTablet (PName )
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21797733
>No, I create an index for a testing table named "tblTestTable", because I don't want to messup the current used table:
creating an index won't mess up anything on the table. it's an additional structure, side-by-side of the table.
you can safely create indexes (just not tooooo many).
0
 

Author Comment

by:atkinsHOU
ID: 21797768
Ok, because this is the first time I create an index, so I just want to do it in a testing table, after adding the index, then I test the website, magic, it works now. So I don't know it is because the index make it work or some other reasons(for example, restart server by our network person....).
0
 

Author Comment

by:atkinsHOU
ID: 21797862
Angel, thank you very much for your help.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question