0

Is there a DMV or other mechanism available that returns the command timeout for an executing session_id?

1 Answer 1

8

The SQL Server database engine has no notion of a command timeout. A query runs until completed, erred, or cancelled by the client application.

Command timeout is implemented entirely by the client API, which cancels the executing command with an attention signal when it runs longer than the specified timeout. This is exactly what happens when you manually cancel a running query in SSMS because it's taking too long.

Consequently, the command timeout is not available on the database server.

1
  • Thanks. That's what I thought the answer would be. Root of issue is a long running process. I can vary the amount of work that get's accomplished... if I know the command timeout. It varies by environment (DEV, TST, PRD) and customer service tier. too expensive to retrofit the timeout as an input parameter. Commented Jun 18, 2021 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.