How to set Query timeout for SQL server in ODBC connection string ?

Boopathy Ravi 0 Reputation points
2023-03-16T14:08:45.4966667+00:00

I am using a ETL tool called Alteryx. It is windows based tool. I have installed Microsoft ODBC driver for the tool to interact with SQL databases. I am creating required data sources in ODBC administrator for the tool to access required databases. I would like to timeout the queries if it runs more than defined time window. I do not see a option to define the Query timeout at data source level, if the data source is created through Microsoft ODBC driver. When I create data source using Data direct ODBC driver, I am given with option to define query timeout. How can I define query timeout for the data source created with Microsoft ODBC driver ?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,675 questions
{count} votes

2 answers

Sort by: Most helpful
  1. CosmogHong-MSFT 22,626 Reputation points Microsoft Vendor
    2023-03-17T05:56:49.2+00:00

    Hi @Boopathy Ravi

    You could use the ODBCTimeout and QueryTimeout properties to show how the QueryTimeout setting on a Database object sets the default ODBCTimeout setting on any QueryDef objects created from the Database object.

    Please refer to this doc for more details: Database.QueryTimeout property (DAO)

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Olaf Helper 40,736 Reputation points
    2023-03-17T06:34:14.5833333+00:00

    I am using a ETL tool called Alteryx.

    That's a 3rd party product, you may better contact the software vendor support.

    I do not see a option to define the Query timeout at data source level

    Of course not, at connection level you can set connect properties, like connect timeout, but not query properties.

    Queriy timeouts are defined per session/query.

    0 comments No comments