How tuning a t-sql query directly inside the Database Engine Tuning Advisor

pmscorca 1,052 Reputation points
2021-04-30T09:49:52.347+00:00

Hi,
I need to tuning a t-sql query by the DTA tool operating directly inside it without using the SSMS, where selecting first the query and then the DTA.
Is it possible, and how? thanks

SQL Server Other
{count} votes

5 answers

Sort by: Most helpful
  1. Olaf Helper 47,436 Reputation points
    2021-04-30T10:57:15.89+00:00

    It's possible, even if I wonder what's good for.

    You find the tool in
    C:\Program Files (x86)\Microsoft SQL Server\ <VersionNo> \Tools\Binn => DTASHELL.exe

    Change <VersionNo> to the version you use, e.g. 120

    0 comments No comments

  2. pmscorca 1,052 Reputation points
    2021-04-30T12:44:10.903+00:00

    Hi, thanks for your reply.

    I try to explain better the question.
    Usually, inside a query window opened in SSMS I specify the query to tune, select it and then with the mouse right-click call the DTA tool, that shows the Query option as a workload.
    In a SQL installation, for an error I cannot accomplish the described action and so I neee to specify the query to tune inside the DTA tool, if possible of course.
    Thanks


  3. pmscorca 1,052 Reputation points
    2021-04-30T13:30:08.337+00:00

    Ok, I've noticed that the query code isn't saved inside the selected script file.
    Thanks


  4. pmscorca 1,052 Reputation points
    2021-05-01T08:01:13.53+00:00

    Hi Olaf,
    inside the DTA I've tried to select a file as a workload, but the query code in this file wasn't saved (likely to a my inadvertence).
    Ok?

    0 comments No comments

  5. AmeliaGu-MSFT 14,006 Reputation points Microsoft External Staff
    2021-05-03T07:28:35.103+00:00

    Hi pmscorca-6887,
    In addition, DTA is inbuilt tool which comes with SSMS.
    You can download and install SSMS 18.x to launch the DTA from SSMS. You also can launch it from \Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\DTASHELL.EXE if you find your workload file.
    Best Regards,
    Amelia


    If the answer is helpful, please click "Accept Answer" and upvote it.
    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

Your answer

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