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?
-
יום שני 07 מאי 2012 01: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?
כל התגובות
-
יום שני 07 מאי 2012 17: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 יום שני 07 מאי 2012 17:16 added the forgotten link towards the BOL for CommondTimeout
- סומן כתשובה על-ידי Stephanie LvModerator יום שני 14 מאי 2012 08:00
-
יום שישי 27 יולי 2012 13: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
-
יום שישי 27 יולי 2012 14: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.