SSMS: keyboard shortcut to execute current row? [duplicate]
SQL Server Management Studio: Is there a way to execute current row (keyboard shortcut) without highlighting it?
Highlighting the text beforehand, i.e. by clicking the combination Home, Shift + End, F5 would appear to be the only option.
See answers here: How can I run just the statement my cursor is on in SQL Server Management Studio?
The add-in SQL Complete has this exact feature. Execute current statement using a hotkey without selecting it. Their free express version has it, but I also recommend standard version for its additional features. It's a major time-saver.
https://connect.microsoft.com/SQLServer/feedback/details/125200/execute-current-statement is a Connect issue on this - Guess it's a low priority.
I've just gotten used to using standard keyboard shortcuts. One such is to (if for example the query i want to work with is written in the end) select everything before this query using ctrl-shift-home, then ctrl-k, ctrl-c to comment this out, hit end, then f5. once i need to get all back i just ctrl-a then ctrl-k,ctrl-u to uncomment again.
In either case, it helps being familiar with the keyboard :)
I know of 2 shortcuts that will perform the Execute
, but if you have more SQL statements within the SQL file, it will execute them all unless you highlight the line you want.
F5
ctrl+E
I've never come across a shortcut that will do that without selecting the row first. There isn't one listed in the SSMS Keyboard Shortcuts MSDN article either, so I don't think it is possible.
This works for me: Home, Shift + Left click
Here's an improvement on DaveRead's answer: Shift+Home, F5
精彩评论