0

I am creating a very complicated view in SQL Server 2014 that takes a long time to execute. Whenever I attempt to execute, I get the following error:

'Timeout Expired. The timeout period elapsed prior to completion 
 of the operation or the server is not responding.'

I attempted to rectify this issue by right-clicking on the name of the view and going to the Properties window. From there, under 'Connection' on the left, I clicked 'View Connection Properties'. However, in this window, I am unable to modify any of the connection properties (they are all greyed out).

I am fairly certain I want to modify the field labeled 'Connection Timeout', which is set to a default value of 15. Is there any way to do so?

bumble_bee_tuna
  • 3,533
  • 7
  • 43
  • 83
Avery B
  • 237
  • 1
  • 11
  • 1
    http://stackoverflow.com/questions/1137190/changing-the-commandtimeout-in-sql-management-studio have you looked at this ? – bumble_bee_tuna Jul 02 '15 at 13:18
  • 1
    There is a difference between a Connection.Timeout and a Command.Timeout. This question has been asked many times before....follow the yellow brick road (above comment). – granadaCoder Jul 02 '15 at 13:26
  • this is not an issue of the view so you cannot solve the issue modifying the view itself (well, maybe you can make it run fast with indexes and such but the timeout is not a sql property of the view). check the manual of the tool you are using to run the view. – Paolo Jul 02 '15 at 13:27
  • I took a look at the link provided, but none of the suggestions in the post seemed to alleviate the problem. Is it possible that the query is just so complex that the server would be unable to handle it no matter what? The view I am attempting to create is comprised of over 20 sub-views. – Avery B Jul 02 '15 at 13:56
  • @AveryB if you ran up against SQL Server's view nesting limit of 32 (views-inside views) you would get an error message. If your query is a never ending CTE loop that could also cause it to never return (but resources should run out eventually). A few other possibilities, but each as esoteric. I've run queries that take hours on SQL server and it handles them fine. – N West Jul 02 '15 at 15:11
  • How are you executing the view (and where are you getting the error message): in SQL Server Management Studio or from another application (maybe using a .Net language) ? – Razvan Socol Jul 04 '15 at 16:58

0 Answers0