Usage





use @ and # cha

WHERE ObjectName LIKE '%Record%Temperature%'

Shortcuts Description





Type TypeDesc AF Aggregate function (CLR) C CHECK constraint D DEFAULT (constraint or stand-alone) F FOREIGN KEY constraint FN SQL scalar function FS Assembly (CLR) scalar-function FT Assembly (CLR) table-valued function IF SQL inline table-valued function IT Internal table P SQL Stored Procedure PC Assembly (CLR) stored-procedure PG Plan guide PK PRIMARY KEY constraint R Rule (old-style, stand-alone) RF Replication-filter-procedure S System base table SN Synonym SO Sequence object U Table (user-defined) V View SQ Service queue TA Assembly (CLR) DML trigger TF SQL table-valued-function TR SQL DML trigger TT Table type UQ UNIQUE constraint X Extended stored procedure

The idea is simple, highlight a text in SSMS text editor and hit the shortcut, highlighted text is passed as a parameter to sp_QueryShortcuts:You can also add a second parameter to selected shortcuts:Because of how the SQL is validating syntax, I've decided toracters to perform certain functions when included in the highlighted text.- at sign will work like a (dot) when separating schema name from object name i.e. 'hr@Users' will be treated as 'hr.Users'- hash sign will work like awildcard i.e. 'ab#xyz' will be treated as 'ab%xyz'.For example we want to use CTRL+5 to find all objectsHere's a short description of all the shortcuts. In future post I will write a bit more on the individual usage and how they work best in combination with others.CTRL+3 - Select TOP 1000 form highlighted table or view ordered by column 1 descending. As an additional parameter you can pass a column name from that table and it will order the results by that column ascending, if you add a hash sign at the end of column name it will order the results descending. You can pass a value as an additional parameter and the shortcut will add a where clause where column with order 1 equals that passed value.CTRL+4 - executes sp_help if the object is a user table or sp_helptext2 for all other typesCTRL+5 - performs a search for database objects with highlighted text in the object name. Object type* can be used as an additional parameter.CTRL+6 - executes sp_WhoIsActive by Adam Machanic. Use 'S' for default values, ‘P’ to include execution plans and ‘D’ to get much more details. (I'm thinking of changing it in the future as I tend to use only one option, most likely it will have some more functionality later on)CTRL+7 - for a selected table in the firs result set it returns index usage with calculated "index performance". In the second result set it will return information about missing indexes for that table with their "Estimated Benefit".CTRL+8: performs a search for columns or parameters and returns parent objects names (tables, views, procedures, functions). Object type* can be used as an additional parameter.CTRL+9 - lists columns or parameters for highlighted object, also converts column list into parameter list that can be copied and used in stored procedures. Object type* can be used as an additional parameter.CTRL+0: performs a search for highlighted text in programmability objects create script. For a many word text you need to place the text in square brackets i.e. [INSERT INTO Users]. Object type* can be used as an additional parameter.