Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Execute SQL Query without Displaying results

Tags:

sql

sql-server

Is it possible that Execute SQL Query without Displaying results?

like

Select * from Table_Name 

after running this query result should not be displayed in sql server.

like image 614
Rajesh Kumar Avatar asked Jun 17 '11 13:06

Rajesh Kumar


People also ask

How do I hide query results?

To hide a query field in Access, open the query that contains the field to hide from the result set in query design view. Then, in the QBE Grid, uncheck the checkbox in the “Show” row of the field you want to hide. Then click the “Save” button in the Quick Access toolbar to save your changes.

How do I exclude results from SQL?

The SQL EXCEPT operator is used to exclude like rows that are found in one query but not another. It returns rows that are unique to one result. To use the EXCEPT operator, both queries must return the same number of columns and those columns must be of compatible data types.

How do I hide the results pane in SQL Server?

If we just use Ctrl+R we can toggle between showing and hiding the results pane and therefore you can see more of the Editor section when you are using SQL Server Management Studio.

How do I hide a SQL query?

You can specify that some elements and attributes be hidden in the schema by using the sql:hide annotation. This is useful when the selection criteria of the query require particular elements or attributes in the schema, but you do not want them returned in the XML document that is generated.


1 Answers

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.

like image 71
deroby Avatar answered Sep 25 '22 16:09

deroby