Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Custom SSMS Shortcuts for ETL Developer. Part 1: SELECT in a Keystroke

By Olga Klimova,

You can save up to 90% of your time if you invoke the most commonly used SQL query, SELECT FROM, with a keyboard shortcut strike. To apply this simple but often overlooked technique, first assign a keyboard shortcut to the query in SQL Server Management Studio.

1. Create a Stored Procedure for SELECT Statement

Execute the following code to create a stored procedure:

CREATE PROCEDURE dbo.sp_select
  @tablename NVARCHAR(200)
AS
DECLARE @cmd NVARCHAR (255)

SET @cmd = 'SELECT TOP 50 * from ' + @tablename
EXEC sp_executesql @cmd
GO

Limiting the result set to a few top records minimizes impact on performance.

2. Create a Keyboard Accelerator for a Stored Procedure

To create a keyboard accelerator for a stored procedure:

  1. On the Tools menu, click Options.
  2. On the Keyboard page, select Ctrl+F1 or other unused keyboard combination in the Shortcut list.
  3. In the Stored Procedure box, type the stored procedure name sp_select, and then click OK.

SSMS Tools/Options dialog box keyboard shortcut mapping

Note. You need to close SSMS and re-open it to make the shortcut setting effective.

3. Get SELECT Query Results with a Keyboard Shortcut Stroke

To execute SELECT statement with a keyboard shortcut:

SELECT query result set

Tip: This technique is the most beneficial during data analysis phase of an ETL project, when you need to look up and analyze content of hundreds of source tables. When typing 'SELECT TOP 100 * FROM <table name>' takes about 10 seconds, calling this query with a keyboard shortcut can take only 1 second and avoids spelling errors. This makes you 9 times more productive! Make use of this technique a habit for all your table content queries and impress your manager and peers with your efficiency!

Total article views: 5943 | Views in the last 30 days: 2
 
Related Articles
BLOG

SQL Server Keyboard Shortcuts

SQL Server Keyboard Shortcuts for Management Studio SQL Server Management Studio is filled with l...

BLOG

SQL #53 – Keyboard shortcut Alt + F1 works now in SSMS 2012

Keyboard shortcut Alt + F1 works now SSMS has a rich set of keyboard shortcuts that works by defa...

SCRIPT

Productivity Keyboard Shortcuts

something to help working with ssms.

FORUM

Productivity Keyboard Shortcuts

Comments posted to this topic are about the item [B]Productivity Keyboard Shortcuts [/B] Awesome! ...

FORUM

Question about SSMS/BIDS shortcut

Is there a keyboard shortcut to move from one field to the next without mousing?

 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones