SSMS -- inhibit results or remove temporary files when query is done



  • I am running several instances of the same query to establish baselines for potential performance optimization. That is, I want to compare timing for two versions of the same query.

    I am using SSMS 18.8 to run the query, the actual db is older still.

    I am using a timing paradigm from: https://stackoverflow.com/questions/11675077/measure-the-time-it-takes-to-execute-a-t-sql-query

    SSMS will put the results (which I don't need in this context) into either a window or a text-file. However, either of these options use to much disk-space and sometimes too much memory as well.

    • Is there a way to compare the queries without having SSMS show/store the results?

    • How do I remove any un-needed files that SSMS creates after running the tests?



  • In SSMS, choose "Query Options" --> select "Results" form the left nav, check "Discard results after execution"

    https://www.databasejournal.com/features/discarding-results-of-a-query-execution-in-sql-server-management-studio/




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2