SQL Server ssms usage

I am in the process of putting my notes into web pages, please keep checking in later for more contents

quick link

mssql_02     home  
top   prev   next  

ssms usage

-- ssms for alwayson read only connection
Additional Connection Parameters


To show the Summary or Details page

On the View menu, click Object Explorer Details. 
The Object Explorer Details page opens, if it is not already open, 
and comes to the front if it is open in the background.

Or, at any time, you can press F7 to display the Object Explorer Details page.

SSMS --> Tools --> Options --> SQL Server Object Explorer --> Scripting 
General scripting options:

Object scripting options: 

Table and view options
Include collation: True, default false
Script Indexes: True

options for sql server object explorer scripting page 

Options (SQL Server Object Explorer-Scripting Page) 

generating scriptsin ssms 

generate and publish script 
looking for sql server log 
Object Explorer --> Management --> SQL Server Logs --> Current --> 
( filter )
Source --> Logon
Message --> Failed

looking for sql server agent log 
Object Explorer --> SQL Server Agent --> Error Logs --> Current

To comment out a portion of your script
Use your mouse to select the text.
On the Edit menu, point to Advanced, and then click Comment Selection. 
The selected text is commented out with dashes (--).

Press CTRL+K and CTRL+C to comment the text, 
or press CTRL+K, CTRL+U to uncomment the text. 

ssms keyboard shortcuts 

-- format sql code
CTRL+SHIFT+Q: Open Query Designer, Paste query code, click OK

CTRL+K+C and CTRL+K+U: comment/uncomment select block of code
CTRL+SHIFT+U and CTRL+SHIFT+L: Change selected text to UPPER/lower case
SHIFT+ALT+Selecting text: select/cut/copy/paste a rectangular block of text ( box selection )

-- Open a new query window
Ctrl+N: Open New Query (Button) Window
Ctrl+R: Show/hide Results Pane
Ctrl+L: Display Query Execution Plan

-- to run a query in query window
f5 (working)
alt+x (working )
CTRL+SHIFT+E ( not working )
ctrl+E ( not working )
F5, CTRL+E or ALT+X: execute currently selected TSQL code

ssms shortcut