Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I execute a single query in SQL Server Management Studio?

Background: I'm using SQL Server Management Studio 2008 and I have a query window open that contains multiple queries.

Is there a keyboard shortcut that will allow me to execute a single query without highlighting the query I would like to run first? Some other SQL tools have shorcuts that run the query that is under the cursor, which keeps the hands on the keyboard, and away from the mouse.

like image 624
Rydell Avatar asked Aug 27 '09 18:08

Rydell


People also ask

How do I select a single line in SQL Server?

While the table name is selected type CTRL + 3 and you will notice that the query will run and will return a single row as a resultset. Now developer just has to select the table name and click on CTRL + 3 or your preferred shortcut key and you will be able to see a single row from your table.


1 Answers

I did some searching and was unable to find any keyboard shortcuts for executing individual lines in SSMS. There is a reference online though.

http://msdn.microsoft.com/en-us/library/ms174205.aspx

Personally I just highlight the row in question (Shift + End or Shift + , etc.) and hit F5.

Ctrl + E works just as well on a Mac.

like image 172
Mayo Avatar answered Sep 20 '22 16:09

Mayo