How to set execution timeout in SSMS for SQL Server Programmatically

  • I want to set the execution timeout in SSMS Connection properties on the 'Connect to Server' page programmatically/automatically.

    I tried to change the 'Execution Timeout' tag in this file

    C:\Users\Kaushik_TKAS\AppData\Roaming\Microsoft\SQL Server Management Studio\18.0\UserSettings.xml

    https://www.mssqltips.com/sqlservertip/7279/ssms-server-connection-information-import-export/

    However, this approach was unsuccessful.

    I also attempted to modify the execution timeout setting in the registry, following this path:

    Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\SQL Server Management Studio\18.0_IsoShell\Packages{4a509-bf0-43da-abee-0a37f1}\Settings\Analysis Services Project

    I changed the value of 'Query timeout', But it did not reflect in SSMS.

     

    My requirement is to set the Execution timeout programmatically without manually going and SSMS and changing it.

  • You'd probably have to close and re-open SSMS for that to work.

    But why? What are you trying to do that would require setting this programmatically. You may be trying to use the wrong tool for this job -- SSMS is a user-facing interactive client.

    Check out sqlcmd. It allows setting query_timeout for each session.

  • We have already tried closing and reopening SSMS. But , that did not work . I want to set this execution timeout for all the sessions in the SSMS programmatically . Not just for one session.

  • the registry setting you changed applies to SSAS queries - so it would never work for what you wish.

    and it seems that this functionality was broken starting with v18 - see https://blog.sqlauthority.com/2020/04/23/ssms-bug-execution-time-out/

  • frederico_fonseca wrote:

    ... it seems that this functionality was broken starting with v18 - see https://blog.sqlauthority.com/2020/04/23/ssms-bug-execution-time-out/%5B/quote%5D

    Tested and still broken on V20.1

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply