?
Solved

increase timeout ms sql 2005 queries from asp

Posted on 2009-02-19
7
Medium Priority
?
701 Views
Last Modified: 2012-05-06
I have this code in an asp script.

It times out too often. How can I icrease the timeout time?

From the ms sql manager it does not tine out, Can it be a connection string issue?

Set MyRecordSet = Server.CreateObject("ADODB.RecordSet")
cn = application("connection")
sql="select count(*) as cuantos from people"
MyRecordSet.Open sql, cn
cuantos=MyRecordSet("cuantos")
MyRecordSet.Close
MyRecordsSet=Nothing

Open in new window

0
Comment
Question by:robrodp
  • 3
  • 2
  • 2
7 Comments
 
LVL 37

Expert Comment

by:momi_sabag
ID: 23681341
try
cn.timeout = 900 (this is 900 seconds=15 minutes)
0
 

Author Comment

by:robrodp
ID: 23681434
cn is the connection string defined in global.asa as:

application("connection")="Provider=SQLNCLI;Server=74.86.187.166\SQL2k5,1435;Database=database;Uid=user;Pwd=password;"

So the  cn.timeout = 900
(this is 900 seconds=15 minutes)
does not work
0
 
LVL 37

Accepted Solution

by:
momi_sabag earned 2000 total points
ID: 23681658
my bad
i was sure cn is a connection object
you can try what is describe here
http://sethbuckley.com/ado-recordset-timeout-on-ms-sql-server/
but it seems weird
anyway,
if you create a connection object (which is probably created implicitly so your won't hurt performance)
 you can set its timeout property
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 23681700
Thinking the other way around, why is your query taking much time..
If you tune it out and bring it out to less time, then no timeouts issues, right..
0
 

Author Comment

by:robrodp
ID: 23681996
Good it works
Now how can I increase the timeout for:

c.Open cn
sql="update table set name='john' where id=123
c.Execute sql
c.Close
set c = nothing
0
 

Author Comment

by:robrodp
ID: 23684597
I have tuned it with indexes
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 23684652
After creating your indexes and if you tune out your query, then I am sure you wont face any Timeout issues.

create indexes on the columns in Where clause and joins to improve performance
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based developeā€¦
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recovā€¦
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

616 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