How to execute query without displaying result?

I want to test performance of some queries by executing it multiple times in SQL Server Management Studio and comparing statistics. My problem is that this method isn’t accurate because after every query result is displayed and memory use of Management Studio grows up.
Important for me is to not increase memory consumption, because return set is large (So I cannot put it to temp table)

I found this question:
How to Execute SQL Query without Displaying results
but it doesn’t fit my needs.

  • When does WHERE filtering occur?
  • Loss of data after updating .Net TableAdapter
  • Cast rowversion to bigint
  • Employee Manager Report - Sql Server
  • How to trace steps in SQL profiler for only particular application
  • Sql server greater than operator gives wrong result on datetime
  • So, is there any way to execute query in SQL Manageement Studio without displaying return data?

    2 Solutions collect form web for “How to execute query without displaying result?”

    In the options section (under Tools–>Options), go to Query Results–>SQL Server and either “Results to Grid” or “Results to Text”.

    There is an option box for “Discard results after execution”. Click the box.

    Now, open another query window and there are no results. I imagine that the results are still being returned from the server, so you have network latency. This should fix the memory problem, though.

    You can solve the network latency problem by running SSMS on the same server as the engine.

    At the top there is an icon which enables Client statistics. This gives you details of the query executed, proccessing times row counts. It will also auto aggregate this data for you if you run the same query multiple time in sequence, and yes these stats are irrespective of rendering times.

    Image of the 'include client statistics' icon

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.