ODBC driver returned following exception -1 Query timeout expired State:S1T00, Origin:[Microsoft][SQL Server Native Client 11.0] What are the steps to resolve?
-
2012년 5월 7일 월요일 오전 1:26I am using Windows 7 64 bit, SQL Server 2012, and ODBC (odbcad32.exe) and accessing an sql database via ODBC. I get the above mentioned error. What do I need to do to resolve it?
모든 응답
-
2012년 5월 7일 월요일 오후 5:15중재자
Hello,
Windows 7 64-bit which SP ?
SQL Server 2012 which edition ( full name + 32 or 64-bit ? )
You wrote "accessing an sql database via ODBC". Please, could you provide your code and your T-SQM statements ? Have you tried to use these T-SQL statements thru SQL Server Management Studio ? If it is not working thru SSMS, it will not work in your application. If it is working, could you provide the statistics of the query ( execution time )
If you are using the .Net Framework 4.0, you have an useful namespace System.Data.Odbc . The OdbcCommand class has a CommandTimeout property with a default value = 30 seconds. Provide a value at least twice of the value returned by the statistics of the query.
http://msdn.microsoft.com/en-us/library/system.data.odbc.odbccommand.commandtimeout.aspx
Don't hesitate to post again for more help or explanations
Have a nice day
Mark Post as helpful if it provides any help.Otherwise,leave it as it is.
- 편집됨 Papy NormandModerator 2012년 5월 7일 월요일 오후 5:16 added the forgotten link towards the BOL for CommondTimeout
- 답변으로 표시됨 Stephanie LvModerator 2012년 5월 14일 월요일 오전 8:00
-
2012년 7월 27일 금요일 오후 1:48
I had this problem today in an ASP application (classic ASP) and solved using your suggestion.
Thanks!!
I post the solution in my blog too.
ASP – [Microsoft][ODBC SQL Server Driver] Query timeout expired
-
2012년 7월 27일 금요일 오후 2:29중재자
Hello Guilherme,
Thanks for your post on your blog ( unluckiliy, i am not understanding the "iberic" languages like spanish or portuguese ).
But don't forget, a good way could to understand why the query is so long. There are too many possibilities. A good way could be to test the query inside SSMS with a "quiet" SQL Server instance. A possible good way would be to have a look at the generated plan ( to see whether the plan find an unoptimized query ). Other possibilities : too small values for the increase size of the data/log files ( these are Windows operations which are always heavy and the time necessary to increase files sizes are always included in the the timeout ), too many connections/queries, too small memory provided to the SQL Server ... But these questions are more related the Database Engine Forum.
Have a nice day
Mark Post as helpful if it provides any help.Otherwise,leave it as it is.

