Solved

How to Extend Timeout Period for a View in SQL Server Mgmt Studio

Posted on 2008-10-15
11
793 Views
Last Modified: 2012-06-21
We are creating fairly complex views in MS SQL Management Studio.  When I go over a certain number of fields requested or a certain number of rows, I get the Timeout Expired error after 30 seconds.
I'd like to let it run a little longer. Yes I can probably tweak it to make it more efficient, but for now, I'd like to give it more time.
Is there a way to do this just for this view?  If not, how do I change the timeout period setting for the database in general?
0
Comment
Question by:dakota5
  • 7
  • 4
11 Comments
 
LVL 8

Expert Comment

by:tiagosalgado
Comment Utility
In MS SQL Management Studio go to menu Tools > Options > Query Execution > SQL Server > General
And set the "Execution time-out" to 0.
0
 

Author Comment

by:dakota5
Comment Utility
Tiagosalgado:

Per your suggestion I checked this, but it is already set to 0.
The error includes the following message--
Error Source:    .Net SQL Client Data Provider

Perhaps there is a separate setting for the Client Data Provider
0
 
LVL 8

Expert Comment

by:tiagosalgado
Comment Utility
Try to add this line to your query (at begin)
SET LOCK_TIMEOUT <milisecounds>
0
 

Author Comment

by:dakota5
Comment Utility
Tiagosalgado:

That didn't work either.  Timed out at 30 seconds, even thought first statement was
SET LOCK_TIMEOUT 40000;
0
 
LVL 8

Expert Comment

by:tiagosalgado
Comment Utility
Hum, that's strange. Try this instead
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Accepted Solution

by:
dakota5 earned 0 total points
Comment Utility
Tiagosalgado:

I think the problem is that these are views being opened in SQL Server Mgmt Studio.
One view creates a list of patient IDs for which data should be accumulated.  The second view uses this list of patient IDs to select lots of data from a large table.
If I run the second view as a standard select statement within Mgmt studio, it takes 38s to run, and I get all the data. (No timeout after 30s)

If I access the second view from outside Mgmt studio, (odbc from Access, for example) I  also get all the data with no timeout- still takes about 38 seconds.

But if I open the second view from within Mgmt Studio-- it times out after 30 seconds.  It is apparently being limited by a setting that affects the displaying of views within management studio (not the underlying queries running on the server).

Any ideas?


0
 
LVL 8

Assisted Solution

by:tiagosalgado
tiagosalgado earned 200 total points
Comment Utility
I don't know if the "Transaction time-out" value  in Tools > Options > Desingers > Table and Database Designer ... is applied to View too. Can you check ?
0
 
LVL 8

Expert Comment

by:tiagosalgado
Comment Utility
In same place, try to uncheck the option "Override connection string time-out .... ".
0
 

Author Comment

by:dakota5
Comment Utility
No, apparently not.  I changed this value to 60 (default was 30).  The view still timed out at 30s
0
 
LVL 8

Expert Comment

by:tiagosalgado
Comment Utility
One more chance. Right click on your server > Properties. Go to Advanced and change Query Wait property.
0
 
LVL 8

Expert Comment

by:tiagosalgado
Comment Utility
Have you open new connection after change that values? Or re-open management studio ?
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

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 Backup & Restore 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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now