Skip to main content

SQL Server Management Studio Keyboard Shortcuts






We often use keyboard shortcuts to access some functionality of SQL Server. Please find below tables documenting shortcut keys we use in SQL Server Management studio. Original document can be referred at http://msdn.microsoft.com/en-us/library/ms174205.aspx for more details.

By default, Management Studio uses the Standard scheme. A second scheme, called SQL Server 2000, closely resembles the tools from SQL Server 2000 (in particular the keyboard shortcuts from the Query Analyzer). To change the keyboard scheme or add additional keyboard shortcuts, on the Tools menu, click Options. Select the desired keyboard scheme on the Environment, Keyboard page. In a few cases, SQL Server Management Studio cannot offer the keyboard shortcuts from Query Analyzer.

Menu Activation:

Action
Standard
SQL Server 2000
Move to the SQL Server Management Studio menu bar
ALT
ALT
Activate the menu for a tool component
ALT+HYPHEN
ALT+HYPHEN
Display the context menu
SHIFT+F10
SHIFT+F10
Display the New File dialog box to create a file
CTRL+N
No equivalent
Display the New Project dialog box to create a new project
CTRL+SHIFT+N
CTRL+SHIFT+N
Display the Open File dialog box to open an existing file
CTRL+O
CTRL+SHIFT+INS
Display the Open Project dialog box to open an existing project
CTRL+SHIFT+O
No equivalent
Display the Add New Item dialog box to add a new file to the current project
CTRL+SHIFT+A
No equivalent
Display the Add Existing Item dialog box to add an existing file to the current project
ALT+SHIFT+A
No equivalent
Display the Query Designer
CTRL+SHIFT+Q
CTRL+SHIFT+Q
Close a menu or dialog box, canceling the action
ESC
ESC

Windows Management and Toolbar

Action
Standard
SQL Server 2000
Close the current MDI child window
CTRL+F4
CTRL+F4
Print
CTRL+P
CTRL+P
Exit
ALT+F4
ALT+F4
Toggle full screen mode
SHIFT+ALT+ENTER
SHIFT+ALT+ENTER
Close the current tool window
SHIFT+ESC
SHIFT+ESC
Cycle through the next MDI child windows
CTRL+TAB
CTRL+TAB
Cycle through the previous MDI child windows
CTRL+SHIFT+TAB
CTRL+SHIFT+TAB
Move to the current tool window toolbar
SHIFT+ALT
No equivalent
Move to the next tool window
ALT+F6
ALT+F6
Move to the previously selected window
SHIFT+ALT+F6
SHIFT+ALT+F6
Opens a new query editor window
No equivalent
CTRL+O
Display Object Explorer
F8
F8
Display Registered Servers
CTRL+ALT+G
No equivalent
Display Template Explorer
CTRL+ALT+T
CTRL+ALT+T
Display Solution Explorer
CTRL+ALT+L
CTRL+ALT+L
Display the Summary Window
F7
F7
Display the Properties Window
F4
F4
Display the Toolbox
CTRL+ALT+X
CTRL+ALT+X
Display the Bookmarks Window
CTRL+K, CTRL+W
No equivalent
Display the Browser Window
CTRL+ALT+R
CTRL+ALT+R
Display the Error List Window (Transact-SQL Editor only)
CRTL+\, CTRL+E
CRTL+\, CTRL+E

Cursor Movement

Action
Standard
SQL Server 2000
Move the cursor left
LEFT ARROW
LEFT ARROW
Move the cursor right
RIGHT ARROW
RIGHT ARROW
Move the cursor up
UP ARROW
UP ARROW
Move the cursor down
DOWN ARROW
DOWN ARROW
Move the cursor to the beginning of the line
HOME
HOME
Move the cursor to the end of the line
END
END
Move the cursor to the beginning of the document
CTRL+HOME
CTRL+HOME
Move the cursor to the end of the document
CTRL+END
CTRL+END
Move the cursor up one screen
PAGE UP
PAGE UP
Move the cursor down one screen
PAGE DOWN
PAGE DOWN
Moves the cursor one word to the right
CTRL+
RIGHT ARROW
CTRL+
RIGHT ARROW
Moves the cursor one word to the left
CTRL+
LEFT ARROW
CTRL+
LEFT ARROW
Text Selection

Action
Standard
SQL Server 2000
Select text from the cursor to the beginning of the document
CTRL+SHIFT+
HOME
CTRL+SHIFT+
HOME
Select text from the cursor to the end of the document
CTRL+SHIFT+END
CTRL+SHIFT+END
Select text from the cursor to the start of the current line
SHIFT+HOME
SHIFT+HOME
Select text from the cursor to the end of the current line
SHIFT+END
SHIFT+END
Select text down line by line starting from the cursor
SHIFT+
DOWN ARROW
SHIFT+
DOWN ARROW
Select text up line by line starting from the cursor
SHIFT+UP ARROW
SHIFT+UP ARROW
Move the cursor up one line, extending the selection
SHIFT+ALT+
UP ARROW
SHIFT+ALT+
UP ARROW
Extend selection up one page
SHIFT+
PAGE UP
SHIFT+
PAGE UP
Extend selection down one page
SHIFT+
PAGE DOWN
SHIFT+
PAGE DOWN
Select the entire current document
CTRL+A
CTRL+A
Select the word containing the cursor, or the closest word
CTRL+W
CTRL+W
Select the current location in the editor, back to the previous location in the editor
CTRL+=
CTRL+=
Extend the selection to the top of the current window
CTRL+SHIFT+
PAGE UP
CTRL+SHIFT+
PAGE UP
Move the cursor to the last line in view, extending the selection
CTRL+SHIFT+
PAGE DOWN
CTRL+SHIFT+
PAGE DOWN
Extend the selection one word to the right
CTRL+SHIFT+
RIGHT ARROW
CTRL+SHIFT+
RIGHT ARROW
Extend the selection one word to the left
CTRL+SHIFT+
LEFT ARROW
CTRL+SHIFT+
LEFT ARROW
Move the cursor to the right one word, extending the selection
CTRL+SHIFT+ALT+
RIGHT ARROW
CTRL+SHIFT+ALT+
RIGHT ARROW
Move the cursor to the left one word, extending the selection
CTRL+SHIFT+ALT+
LEFT ARROW
CTRL+SHIFT+ALT+
LEFT ARROW

Bookmark

Action
Standard
SQL Server 2000
Set or remove a bookmark at the current line
CTRL+K, CTRL+K
CTRL+F2
Next bookmark
CTRL+K, CTRL+N
F2
Previous bookmark
CTRL+K, CTRL+P
SHIFT+F2
Clear bookmarks
CTRL+K, CTRL+L
CTRL+SHIFT+F2

Tree Control

Action
Standard
SQL Server 2000
Collapse tree nodes
- (on the numeric keypad)
- (on the numeric keypad)
Expand all tree nodes
* (on the numeric keypad)
* (on the numeric keypad)
Scroll the tree control up in the window
CTRL+UP ARROW
CTRL+UP ARROW
Scroll the tree control down in the window
CTRL+ DOWN ARROW
CTRL+ DOWN ARROW



Code Editor Keyboard Shortcuts
[All shortcuts are not implemented in all types of code editors.]
Action
Standard
SQL Server 2000
Toggle the full-screen display
SHIFT+ALT+ENTER
SHIFT+ALT+ENTER
Scroll text up one line
CTRL+UP ARROW
CTRL+UP ARROW
Scroll text down one line
CTRL+
DOWN ARROW
CTRL+
DOWN ARROW
Reverse the last editing action
CTRL+Z
CTRL+Z
Restore the previously undone edit
CTRL+SHIFT+Z
or
CTRL+Y
or
ALT+SHIFT+BACKSPACE
CTRL+SHIFT+Z
or
CTRL+Y
or
ALT+SHIFT+BACK SPACE
Insert the body of the specified file into the current window.
ms174205.note(en-us,SQL.100).gifNote:
The window name is not changed to match the specified file.
No equivalent
CTRL+SHIFT+P
Save the selected item
CTRL+S
CTRL+S
Save all
CTRL+SHIFT+S
CTRL+SHIFT+S
Close
CTRL+F4
CTRL+F4
Print
CTRL+P
CTRL+P
Exit
ALT+F4
ALT+F4
Delete all text in the current file
CTRL+SHIFT+DEL
CTRL+SHIFT+DEL
Display the Go To Line dialog box
CTRL+G
CTRL+G
Increase line indent
TAB
TAB
Decrease line indent
SHIFT+TAB
SHIFT+TAB
Make the selected text upper case
CTRL+SHIFT+U
CTRL+SHIFT+U
Make the selected text lower case
CTRL+SHIFT+L
CTRL+SHIFT+L
Make the selected text a comment
CTRL+K, CTRL+C
CTRL+SHIFT+C
Uncomment the selected text
CTRL+K, CTRL + U
CTRL+SHIFT+R
Open a new query with current connection
CTRL+Q
CTRL+N
Open database in Object Explorer
ALT+F8
ALT+F8
Specify values for template parameters
CTRL+SHIFT+M
CTRL+SHIFT+M
Execute the selected portion of the query editor or the entire query editor if nothing is selected
F5
or
CTRL+E
or
ALT+X
F5
or
CTRL+E
or
ALT+X
Parse the selected portion of the query editor or the entire query editor if nothing is selected
CTRL+F5
CTRL+F5
Display the estimated execution plan
CTRL+L
CTRL+L
Cancel the executing query
ALT+BREAK
ALT+BREAK
Include actual execution plan in the query output
CTRL+M
CTRL+K
Open the Query Option dialog box
No equivalent
CTRL+SHIFT+O
Output results in a grid
CTRL+D
CTRL+D
Output results in text format
CTRL+T
CTRL+T
Output results to a file
CTRL+SHIFT+F
CTRL+SHIFT+F
Show or hide the query results pane
CTRL+R
CTRL+R
Toggle between query and results pane
F6
F6
Move to the next active window in Management Studio
CTRL+F6
CTRL+F6
Auto hide all
ALT+ENTER
No equivalent
Windows
CTRL+W
No equivalent
Open SQL Server Profiler
CTRL+ALT+P
CTRL+ALT+P

Text Manipulation in Code Editor

Action
Standard
SQL Server 2000
Insert a new line
ENTER or SHIFT+ENTER
ENTER or SHIFT+ENTER
Swap the characters on either side of the cursor (Does not apply to the SQL Editor.)
CTRL+T
No equivalent
Delete on character to the right of the cursor
DELETE
DELETE
Delete one character to the left of the cursor
BACKSPACE
or
SHIFT+
BACKSPACE
BACKSPACE
or
SHIFT+
BACKSPACE
Insert the number of spaces configured for the editor
TAB
TAB
Insert a blank line above the cursor
CTRL+ENTER
CTRL+ENTER
Insert a blank line below the cursor
CTRL+SHIFT+
ENTER
CTRL+SHIFT+
ENTER
Change the selected text to lowercase
CTRL+SHIFT+L
CTRL+SHIFT+L
Change the selected text to uppercase
CTRL+SHIFT+U
CTRL+SHIFT+U
Toggle between insertion mode and overtype mode
INSERT
INSERT
Move selected lines to the left on tab stop
SHIFT+TAB
SHIFT+TAB
Delete the word to the right of the cursor
CTRL+DELETE
CTRL+DELETE
Delete the word to the left of the cursor
CTRL+BACKSPACE
CTRL+BACKSPACE
Transpose the words on either side of the cursor (Does not apply to the SQL Editor.)
CTRL+SHIFT+T
CTRL+SHIFT+T

Transact-SQL Debugger

Action
Standard
SQL Server 2000
Start or continue debugging
ALT+F5
No equivalent
Stop debugging
SHIFT+F5
No equivalent
Step into
F11
No equivalent
Step over
F10
No equivalent
Step out
SHIFT+F11
No equivalent
Implement the Run To Cursor command
CTRL+F10
No equivalent
Display the QuickWatch dialog box
CTRL+ALT+Q
No equivalent
Toggle breakpoint
F9
No equivalent
Delete all breakpoints
CTRL+SHIFT+F9
No equivalent
Display the Breakpoints window
CTRL+ALT+B
No equivalent
Break all
CTRL+ALT+BREAK
No equivalent
Display the Watch 1 window
CTRL+ALT+W, 1
No equivalent
Display the Watch 2 window
CTRL+ALT+W, 2
No equivalent
Display the Watch 3 window
CTRL+ALT+W, 3
No equivalent
Display the Watch 4 window
CTRL+ALT+W, 4
No equivalent
Display the Autos window
CTRL+ALT+V, A
No equivalent
Display the Locals window
CTRL+ALT+V, L
No equivalent
Display the Immediate window
CTRL+ALT+I
No equivalent
Display the Call Stack window
CTRL+ALT+C
No equivalent
Display the Threads window
CTRL+ALT+H
No equivalent


Microsoft IntelliSense

Action
Standard
SQL Server 2000
List members
CTRL+SPACE
or
CTRL+J
CTRL+J
Complete word
ALT+RIGHT ARROW
ALT+RIGHT ARROW
Parameter information
CTRL+SHIFT+SPACE
No equivalent
Jump between syntax pairs
CTRL+]
No equivalent

Document Window and Browser

Action
Standard
SQL Server 2000
Toggle full-screen mode
SHIFT+ALT+ENTER
SHIFT+ALT+ENTER
Move to the next pane of a split pane view of a document
F6
F6
Move to the previous document in the editor or designer
CTRL+SHIFT+F6
CTRL+SHIFT+TAB
CTRL+SHIFT+F6
CTRL+SHIFT+TAB
Move to the previous pane of a document in split pane view
SHIFT+F6
SHIFT+F6
Display the Browser Window
CTRL+ALT+R
CTRL+ALT+R
Back, display the previous page in the viewing history
ALT+LEFTARROW
ALT+LEFTARROW
Forward, display the next page in the viewing history
ALT+RIGHTARROW
ALT+RIGHTARROW

Solution Explorer

Action
Standard
SQL Server 2000
Display Solution Explorer
CTRL+ALT+L
CTRL+ALT+L
Display the New File dialog box to create a new file
CTRL+N
CTRL+SHIFT+INS
Display the New Project dialog box to create a new project
CTRL+SHIFT+N
CTRL+SHIFT+N
Display the Open File dialog box to open an existing file
CTRL+O
No equivalent

Help and Books Online

Action
Standard
SQL Server 2000
Help
F1
F1
Help on "How Do I"
CTRL+F1
CTRL+F1
Books Online Contents
CTRL+ALT+F1
CTRL+ALT+F1
Books Online Index
CTRL+ALT+F2
CTRL+ALT+F2
Help Search
CTRL+ALT+F3
CTRL+ALT+F3
Dynamic Help
CTRL+ALT+F4
CTRL+ALT+F4
Help Favorites
CTRL+ALT+F
CTRL+ALT+F

Search Keyboard

Action
Standard
SQL Server 2000
Display the Find dialog box
CTRL+F
CTRL+F
Display the Replace dialog box
CTRL+H
CTRL+H
Start incremental search. Type the characters to search for or press CTRL+I to search for characters from the previous search
CTRL+I
CTRL+B
Find the next occurrence of the previous search text
F3
F3
Find the previous occurrence of the search text
SHIFT+F3
SHIFT+F3
Find the next occurrence of the currently selected text
CTRL+F3
CTRL+F3
Find the previous occurrence of the currently selected text
CTRL+SHIFT+F3
CTRL+SHIFT+F3
Display the Replace in Files dialog box
CTRL+SHIFT+H
CTRL+SHIFT+H
Reverse incremental search so it starts at the bottom of the file and searches to the top
CTRL+SHIFT+I
CTRL+SHIFT+I
Select or clear the Search up option in Find and Replace
ALT+F3, B
ALT+F3, B
Stop the Find in Files search
ALT+F3, S
ALT+F3, S
Select or clear the Find whole word option in Find and Replace
ALT+F3, W
ALT+F3, W
Selects or clears the Wildcard option in Find and Replace
ALT+F3, P
ALT+F3, P

Cut and Paste Keyboard

Action
Standard
SQL Server 2000
Cut (delete the currently selected item and place it to the Clipboard)
CTRL+X
or
SHIFT+DELETE
CTRL+X
or
SHIFT+DELETE
Copy to the Clipboard
CTRL+C
or
CTRL+INSERT
CTRL+C
or
CTRL+INSERT
Paste from the Clipboard at the insertion point
CTRL+V
or
SHIFT+INSERT
CTRL+V
or
SHIFT+INSERT

Log Viewer Keyboard

Action
Standard
SQL Server 2000
Refresh
F5
F5
Move between the Select logs pane and the Log file summary pane
F6
F6
Move to the Log file summary pane
ALT+S
ALT+S
Load a new log
CTRL+SHIFT+L
CTRL+SHIFT+L
Export a log
CTRL+SHIFT+E
CTRL+SHIFT+E
Filter a log
CTRL+SHIFT+F
CTRL+SHIFT+F
Search in a log
CTRL+SHIFT+S
CTRL+SHIFT+S

Activity Monitor

Action
Standard
SQL Server 2000
Refresh
F5
F5
Filter the monitor display
CTRL+SHIFT+F
CTRL+SHIFT+F

Replication Monitor

Action
Standard
SQL Server 2000
Refresh
F5
F5
Open a detail window from a grid
ENTER
ENTER




Replication Conflict Viewer

Action
Standard
SQL Server 2000
Define filter
F6
F6
Apply filter
F7
F7
Show all columns
F8
F8

Comments

Popular posts from this blog

How to kill a negative SPID (like SPID -2) in SQL Server?

Rarely this scenario will arise when most likely you see this negative SPID (most likely SPID -2) is blocking other transaction causing issues. If you try to kill it using normal KILL command, it will fail reporting below error: Msg 6101, Level 16, State 1, Line 1 Process ID <SPID Number> is not a valid process ID. Choose a number between 1 and 2048 This is because of an orphaned distributed transaction ID.  Please follow below steps to kill it: Step 1: -- Find the UOW Number select req_transactionUOW from master..syslockinfo where req_spid = <SPID Number> --  <SPID Number>  is -2 most likely. Step 2: -- Copy the UOW number from Step one KILL ‘<UOW Number>’ This will kill the negative SPID resolving the issue.  However please note following points: 1. For SPID -2, you may find multiple UOW numbers. Please start killing them one by one. Typically killing first UOW will resolve the issues. (ie. will kill all UOW and release

DMV/TSQL to find out basic hardware information of the SQL Server including when SQL Server started.

Please use below code: However, please be advised that it can not tell correct information around virtualization.  For example, it will show Hypervisor even if SQL runs on a physical OS where Hyper-V is on. So use this query only when you do not have sufficient access on underlying Windows Operating system to get these information directly. -- Basic hardware information for SQL Server (sys.dm_os_sys_info) /* This query is courtesy of https://sqlserverperformance.wordpress.com/. All credits goes to original author. */ SELECT cpu_count AS [Logical CPU Count] , scheduler_count , hyperthread_ratio AS [Hyperthread Ratio] , cpu_count / hyperthread_ratio AS [Physical CPU Count] , physical_memory_kb / 1024 AS [Physical Memory (MB)] , committed_kb / 1024 AS [Committed Memory (MB)] , committed_target_kb / 1024 AS [Committed Target Memory (MB)] , max_workers_count AS [Max Workers Count] , affinity_type_desc AS [Affinity Type] , sqlserver_start_time AS [

‘Trace Skipped Records’ – What is this and how to resolve it while using SQL Server Profiles?

In some very rare case, you may experience a very weired message in profiler’s output as ‘Trace Skipped Records’ while you trace something on SQL Server. Screenshot of similer situation is as below: This is not an error but it comes by design of SQL Server (I believe so). When you are using SQL profiler and return data is too big to fit in the GUI (for me, it is an enormous xml), SQL Server simply prints this message and proceed to next step. Mostlikely this is to save server’s memory and performance. Although not suggested and guranteed, you can try to run a server side trace and dump data in a file which should capture all the data. However, it is strongly not recommended to run a trace on your production server from server side. Microsoft will probally document this limitation in future. More details may be found at https://connect.microsoft.com/SQLServer/feedback/details/304225/msft-edw-profiler-displays-trace-skipped-records-for-large-530kb-batch