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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Can not execute a view
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

85 Posts

Posted - 01/14/2010 :  12:19:48  Show Profile  Reply with Quote

I created a view which has a complicated query (like INNER JOIN, UNION…..) and takes long time to run.
It takes 60 seconds to run in the Query Analyzer (with the same query) to display the result.
But when I run the “Execute SQL” in the view, after 30 seconds, I got this error message:

Microsoft SQL Server Management Studio
SQL Execution Error.

Executed SQL statement: SELECT ...
Error Source: .Net SqlClient Data Provider
Error Message: Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
OK Help

How to set in the SQL Server Management Studio to let the execution time never expired?


Almighty SQL Goddess

38200 Posts

Posted - 01/14/2010 :  12:21:34  Show Profile  Visit tkizer's Homepage  Reply with Quote
Query the view in a new query window rather than through "Execute SQL". By default, the new query window has a timeout value of 0 which means run indefinitely until it completes (successfully or is rolled back).

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

Yak Posting Veteran

85 Posts

Posted - 01/14/2010 :  13:16:16  Show Profile  Reply with Quote
Thank you Tara,
Yes, that what I did to run the query in a new query window and used 60 seconds to finish.
But, my question is how we can set the Management Studio to run the query in the view. I know it is unnecessary to do in this way, but I'm just wondering if there is a way to do this.

Appreciate for your response.
Go to Top of Page

Not Just a Number

15586 Posts

Posted - 01/14/2010 :  13:19:38  Show Profile  Reply with Quote
I'm not sure I follow...

Post the DDL of the view, and perhaps the DDL of the tables in the view



Hint: Want your questions answered fast? Follow the direction in this link

Add yourself!

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000