How to Execute SQL Query without Displaying results

I’m surprised nobody came up with the answer : switch on the “discard query results after execution” option; l I’m pretty sure that was what the interviewer was after. SET FMT ONLY is totally different thing IMHO.

In SSMS

  • open a new query
  • in the menu select Query / Query options
  • select the Results pane
  • check the “discard result after execution”

The reason you might want to do this is to avoid having to wait and waste resources for the results to be loaded into the grid but still be able to have e.g. the Actual Execution Plan.

Leave a Comment