SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Productivity Keyboard Shortcuts 2

By Emil Bialobrzeski,

1. Go to Tools >> Options

2. Environment // Keyboard

3.

For CTRL+3 enter DECLARE @DB NVARCHAR(500) SET @DB = DB_NAME() EXEC master.dbo.Shortcuts 3, @DB,

For CTRL+4 enter DECLARE @DB NVARCHAR(500) SET @DB = DB_NAME() EXEC master.dbo.Shortcuts 4, @DB,

For CTRL+5 enter DECLARE @DB NVARCHAR(500) SET @DB = DB_NAME() EXEC master.dbo.Shortcuts 5, @DB,

For CTRL+6 enter DECLARE @DB NVARCHAR(500) SET @DB = DB_NAME() EXEC master.dbo.Shortcuts 6, @DB,

For CTRL+7 enter DECLARE @DB NVARCHAR(500) SET @DB = DB_NAME() EXEC master.dbo.Shortcuts 7, @DB,

For CTRL+8 enter DECLARE @DB NVARCHAR(500) SET @DB = DB_NAME() EXEC master.dbo.Shortcuts 8, @DB,

For CTRL+9 enter DECLARE @DB NVARCHAR(500) SET @DB = DB_NAME() EXEC master.dbo.Shortcuts 9, @DB,

For CTRL+0 enter DECLARE @DB NVARCHAR(500) SET @DB = DB_NAME() EXEC master.dbo.Shortcuts 0, @DB,

4. Run script

5. Restart SSMS

Description:

CTRL+3: selects TOP 1000 rows from a selected table or view (highlight table name in text editor and hit shortcut). If you pass a second parameter that is a column name in the given table it will sort the results by that column ascendible, if you add % to the second parameter it will sort descendible ex: ‘dbo.Table’,’Column2%’. If there is a column with name ID and you pass a value it will return rows with passed ID ex: ‘dbo.Table’, 3

CTRL+4: executes sp_help if the object is a table or if it's a SP,FN,TR,VW executes sp_helptext

CTRL+5: searches for a database object with selected name in it (# char works like % wildcard) ex: ‘ab#xyz’ will find you all objects that name starts with ‘ab’ and ends with ‘xyz’

CTRL+6: Is using a procedure written by Adam Machanic sp_WhoIsActive it’s a great replacement for sp_who and with much more details. Use ‘S’ as parameter and hit CTRL+6 to execute with default values, ‘P’ to include execution plans and ‘D’ to get much more details.

CTRL+7: NOT IMPLEMENTED

CTRL+8: searches for table or view with selected column name in it ex: ‘ColName#’ will look for tables/views with column name LIKE ‘ColName%’

CTRL+9: listing columns from selected table/view ex: ‘Table1’ will return a list of columns for that table

CTRL+0: looks for an object that contains selected phrase in the objects script (# char works like % wildcard) ex: ‘Insert%into%Table1’ will give you objects with that string in the object script

Total article views: 3497 | Views in the last 30 days: 6
 
Related Articles
FORUM

Identifying ASCII characters in NVARCHAR columns

Identifying ASCII characters in NVARCHAR columns

FORUM

FK selection (an nvarchar(30) column or four int columns)

FK selection (an nvarchar(30) column or four int columns)

FORUM

Different Behaviour of VARCHAR and NVARCHAR

Variables declared with VARCHAR and NVARCHAR were behaviouring differently.

FORUM

Can I encrypt ntext and nvarchar(max) columns ?

Can I encrypt ntext and nvarchar(max) columns ?

FORUM

Error converting data type nvarchar to numeric

When attempting to convert an nvarchar column to decimal

Tags
productivity    
shortcuts    
ssms    
tool    
tools    
utility    
 
Contribute