How can we increase t sql query execution time high in ssms

NN 0 Reputation points

How can we increase t sql query execution time high in ssms

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

2 answers

Sort by: Most helpful
  1. CosmogHong-MSFT 15,211 Reputation points Microsoft Vendor

    Hi @NN

    If you want to increase application timeout, not query execution time. It'll be changed in the SSMS (because SQL has no concept of a timeout)

    click Tools --> Options --> 'Query Execution' --> 'Execution time-out' ,0 indicates an unlimited wait (no time-out).

    Also, you might try adding a meaningless while loop to increase the execute time of a whole query.

    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. Craig Fick 0 Reputation points

    I am making assumptions, but this sounds like you are asking how to optimize your query. This can be done a few ways.

    1. Filter out your joins. Say you are joining to a table of states and you only need the State "New York" for instance.


    SELECT * FROM Table1 tab

    LEFT JOIN States sta

    ON tab.State = tab.State AND sta.State = 'New York'

    1. Reduce columns to only needed columns.


    This 'SELECT State From Table1'


    1. Avoid functions you might not need like ORDER BY for example.
    2. Remove any redundancy in the code.
    3. Examine the estimated execution plan to see what aspects of your code is slowing down execution time the most and improve that. The higher the Cost % the more taxing the code is on your overall execution time.
      1. Select all of the code you wish to improve.
        1. CTRL + L
    0 comments No comments