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)
4 Comments. Leave new
Select the query and type CTRL + E is another option to execute query.
You can also press Alt + X to execute a query, is works the same as F5
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.
Great stuff. How about Ctrl + E…just this one all the time. I like the Alt + X, JD.