Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Time Out Errors in Stored Procedures

Author  Topic 

mistux
Yak Posting Veteran

90 Posts

Posted - 2005-11-09 : 14:17:06
I am using MS SQL 2000 and MS Access 2000 (ADP not MDB) and all of a sudden after weeks of using the application I am starting to get Timeout Errors in stored procedures that previously worked just fine. (I am not using ADO code to run them, rather I am using CurrentConenction.execute() to run them.)

When I go run them in Query Analizer it also gives me a timeout error, unless I let it run for 7.20 minutes.

I went back to an "old" copy of the data and sp and ran one of them and it ran in less then a second, when I run the same sp on the current system I stopped it after 5 minutes. The data all looks good and about the same number of records. I did look at the execution plan for both and they are vastly different. Is there a way to tell SQL Server to "redo the plan?"

How can a sp work one day and the next not work? The one I am working with was used every singe day, then it stopped working.

Another one stoped working then the next day it worked!

Michael
For all your DNC needs for your CNC machines. www.mis-group.com

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2005-11-09 : 15:15:07
Try UPDATE STATISTICS for all tables involved in the query.

>>Is there a way to tell SQL Server to "redo the plan?"
recompile the SP.

Be One with the Optimizer
TG
Go to Top of Page

mistux
Yak Posting Veteran

90 Posts

Posted - 2005-11-09 : 19:29:15
did find out that if I changed one line it ran in under a second:

HAVING (dbo.vShipping_WOIDItem_Balance_KIT.BalLng <= 0)

If I took the less then away it ran in under a second???


Michael
For all your DNC needs for your CNC machines. www.mis-group.com
Go to Top of Page

mistux
Yak Posting Veteran

90 Posts

Posted - 2005-11-09 : 19:30:10
quote:
Originally posted by TG

Try UPDATE STATISTICS for all tables involved in the query.



How do I do that? I am still teaching myself to be the SQL admin.

Michael
For all your DNC needs for your CNC machines. www.mis-group.com
Go to Top of Page
   

- Advertisement -