How to Execute Query Without Using F5 or Query Toolbar in SSMS? – Interview Question of the Week #224

Question: How to Execute Query Without Using F5 or Query Toolbar in SSMS?

Answer: I had an interesting situation where I was presenting a private training for an organization and during the presentation one of the attendees asked me if I know a unique way to execute a query in SSMS. What essentially attendee was saying that generally, people run the query by either of the following ways and if I know any unique method outside of the known methods.

Here are the generic methods to execute query:

Method 1: Select the query and hit F5

Method 2: Click on the execute button in the toolbar

Method 3: Go to toolbar >> Query and select option Execute

Method 4: Highlight the query and right click over it and click on Execute

Now the question was if there was any other way to execute queries. Absolutely, I know one more method to execute a query which is generally not known much. Let us see it over here.

First, go to Options Dialog inside SQL Server Management Studio. Over here, type in following value. Please do not forget to include the greater than sign there as without that it will not work. Now just click enter and you will notice that SSMS will automatically execute the query.

Trust me, I have yet to see anyone else knowing this little trick. I do not think it makes anyone any more efficient or better. However, these tricks make me wonder how many new things which are out there and I am not aware of the same.

Reference: Pinal Dave (https://blog.sqlauthority.com)

SQL Server, SQL Server Management Studio, SQL Shortcut, SSMS
Previous Post
Dirty Pages – How to List Dirty Pages From Memory in SQL Server? – Interview Question of the Week #223
Next Post
When Was SQL Server Last Restarted? – Interview Question of the Week #225

Related Posts

4 Comments. Leave new

  • Select the query and type CTRL + E is another option to execute query.

    Reply
  • You can also press Alt + X to execute a query, is works the same as F5

    Reply
  • Cory Buczkowski
    May 12, 2019 5:41 pm

    Hey Dave, love your stuff. You can also right click on a stored procedure in the object explorer window of management studio and choose to execute it.

    Reply
  • edhurtado@yahoo.com
    May 12, 2019 11:07 pm

    Great stuff. How about Ctrl + E…just this one all the time. I like the Alt + X, JD.

    Reply

Leave a Reply Cancel reply

Exit mobile version