As a long time Toad for Oracle user, I have gotten used to hitting Ctrl+Enter and having just the statement under the cursor be executed.
In SQL Server Management St
I use a workaround: I comment queries I'm not using. You can use CTRL-K, CTRL-C to comment the SQL you've highlighted. Use CTRL-K, CTRL-U to uncomment. That way, you can comment all other queries, and execute the one you're interested in with F5.
Easiest way to do this is assignment for CTRL
+ Enter
combination for action Query.Execute in SQL Server Management Studio
.
Tools > Options
menu.Environment > Keyboard
page in left pane.Query.Execute
action and select it.SQL Query Editor
in "Use new shortcut in:"
dropdown list.CTRL + Enter
combination in press shortcut keys:
textbox.Assign
button.Shortcut currently used by:
to Query.Execute (Ctrl+Enter (SQL Query Editor))
OK
. Done
.Ok, so what I'm getting from all these answers is "No, that is not possible."
Edit:
Here is how I was able to do this:
1 - Download SQL Developer
2 - Download the jTDS driver
3 - Follow these instructions to add that driver to SQL Developer
4 - Connect to SQL Server using SQL Developer (cool!)
5 - Run it and life is good
Use Ctrl+KU to select a line. Then use F5 to run it.
Although it only works for single line selection, still I find it quite useful.
Hope it helps!!
Somebody suggested this features on Devart dbForge SQL Complete (addon for Management Studio) , and it's still in the development stage. Let's hope that it's finished and doesn't get abandoned halfway through development.
If it's the having to move your hand to the mouse part that bothers you, you can hold the Ctrl down while hitting an up or down arrow key to select a line at once.