Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I program a keyboard shortcut to select top 1000* from selected table?

Is there a way to create a keyboard shortcut in ssms 2012 that when pressed will have the same effect as select top 1000 * from mytable ?

I have explored this already: http://msdn.microsoft.com/en-us/library/ms174178.

Often times when exploring a database very frequently the programmer needs to select top records from tables.

If this is not customizable in ssms, I would be happy with a c# solution,

like image 654
Alex Gordon Avatar asked Feb 15 '13 18:02

Alex Gordon


1 Answers

Tools -> Options, then Environment -> Keyboard -> Query Shortcuts. Assign a key to be:

select top 1000 * from 

Notice no table name. Now press OK, and open a new query window. Highlight a table name and then hit your key combo.

like image 106
muhmud Avatar answered Sep 21 '22 01:09

muhmud