none
ODBC CommandTimeout

    Question

  • We are using a third party application, which  uses ODBC to connect to SqlServer.

    The Client application is setting the ODBC Command property :  CommandTimeout , to 20 seconds and this is embedded inside the code of the application. Is there anyway to intercept this property from inside the SqlServer and modify it to a higher value , so that some of our queries won't timeout ?

     

    Thanks,

         

    Thursday, August 28, 2008 12:55 PM

Answers

  • No, it won't be possible to change this value on the SQL Server side, because the command timeout is purely a client-side property.  What happens with CommandTimeout is, SQL Server will just chug along performing a query and doesn't know anything about a timeout, and when the client determines that the query is taking too long, it will then send a message to the server telling it to cancel the query.  So, since the timeout value is purely a client-side thing, you won't be able to change it inside SQL Server.

     

    I would suggest speaking with the vendor of the third-party application and asking that they manifest the Timeout value to your application, so that you can change it yourself, or alternatively trying to change the nature of your query so that it takes less time.

    Thursday, August 28, 2008 7:06 PM

All replies

  • No, it won't be possible to change this value on the SQL Server side, because the command timeout is purely a client-side property.  What happens with CommandTimeout is, SQL Server will just chug along performing a query and doesn't know anything about a timeout, and when the client determines that the query is taking too long, it will then send a message to the server telling it to cancel the query.  So, since the timeout value is purely a client-side thing, you won't be able to change it inside SQL Server.

     

    I would suggest speaking with the vendor of the third-party application and asking that they manifest the Timeout value to your application, so that you can change it yourself, or alternatively trying to change the nature of your query so that it takes less time.

    Thursday, August 28, 2008 7:06 PM
  • Thanks.

     

    Thursday, August 28, 2008 7:24 PM