November 13, 2011 at 12:06 pm
I am having a view on mutiple tables across 4 databases, and one of the table is having 6 million records....when iam executing the view iam getting time outs........
here is the error:
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.
Can any one tell me how to overcome this.
Thanks.
November 13, 2011 at 1:38 pm
What exactly are you doing that generates that? If you're using the view designer, stop doing so, it's a bug-ridden mess.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 13, 2011 at 1:49 pm
yes, i was using view designer and getting that error. I had to see it because i am getting the same error in the production database error log and it is slowing down the stored procedure.
Can you tell me how to avoid this error.
Thanks.
November 13, 2011 at 3:23 pm
Don't use the view designer (the management studio query windows don't have a timeout set by default)
Optimise your view.
Timeout is a client setting, SQL Server itself doesn't have query timeouts.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 13, 2011 at 3:24 pm
Are the databases on the same instance or will it query data off a different instance/server?
It seems like the view needs some tuning (or even using a divide'n'conquer approach).
Can you post the query and the actual execution plan (when calling the view from a query window you shouldn't get the time out error, so it should be possible to get the actual plan).
September 19, 2017 at 9:55 am
Hello there is solution:
Run -> regedit -> Computer\HKEY_CURRENT_USER\Software\Microsoft\SQL Server Management Studio\11.0(or 14.0 depends on version of SSMS)\DataProject\SQLQueryTimeout
Change Value 30 to 300
Problem solved.
September 19, 2017 at 10:44 am
tomashons - Tuesday, September 19, 2017 9:55 AMHello there is solution:Run -> regedit -> Computer\HKEY_CURRENT_USER\Software\Microsoft\SQL Server Management Studio\11.0(or 14.0 depends on version of SSMS)\DataProject\SQLQueryTimeout
Change Value 30 to 300
Problem solved.
But what about performance of the query ? is it as expected ? If not , have to look at the statistics and their maintenance , and of course the tuning of the view.
September 19, 2017 at 11:42 am
Please note: 6 year old thread.
And yes, changing the timeout from 30 seconds to 5 minutes may stop it timing out, but it's not fixing the problem (slow query that's timing out in production)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 20, 2017 at 10:26 am
tomashons - Tuesday, September 19, 2017 9:55 AMHello there is solution:Run -> regedit -> Computer\HKEY_CURRENT_USER\Software\Microsoft\SQL Server Management Studio\11.0(or 14.0 depends on version of SSMS)\DataProject\SQLQueryTimeout
Change Value 30 to 300
Problem solved.
I'm thinking that's putting a band-aid on a stab-wound. Having things timeout is an important clue in the detection of really bad code. Making registry changes to accommodate such things is also not what I'd consider a best practice, either. The real problem is the code... not some settings. Until you fix the code, the problem is not solved.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply