how to Configure or Set query execution timeout from transact SQL

Jahangir Hossen, Unit Head 0 Reputation points
2026-09-26T10:00:58.6533333+00:00

my execution timeout is always show 90, but i need to set it 0

SQL Server | SQL Server Transact-SQL
0 comments No comments

2 answers

Sort by: Oldest
  1. Erland Sommarskog 137.6K Reputation points MVP Volunteer Moderator
    2026-09-26T20:25:49.18+00:00

    You cannot set that timeout from T-SQL, as this is a client-side setting over which SQL Server has zero control.

    Exactly how you set the timeout depends on the API you are using. For instance, in .Net it is a property on the SqlCommand object.

    Was this answer helpful?

    0 comments No comments

  2. Deepesh Dhake 1,245 Reputation points
    2026-09-28T13:38:02.9133333+00:00

    This cannot be done from TSQL.

    To fix it from SSMS tool:

    1. Update SSMS to 21.6.17 or later, or to SSMS 22.
    2. Fix your saved connections. In the Modern connection dialog, open each saved or recent connection's properties and set the execution timeout to 0.
    3. Check the global default at Tools then Options then Query Execution then SQL Server then General then Execution time-out = 0.
    4. Open new query windows, since existing windows keep the old value.

    User's image

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.