Search notes:

SQL Server Management Studio (SSMS)

SSMS is an integrated environment to configure, monitor and administer instances of SQL Server.

Installation

SSMS can be installed with Chocolatey:
choco install -y sql-server-management-studio

Executing an SQL statement

In order to execute a single SQL statement, in needs to be selected and executed by pressing F5. Unfortunately, it looks as though its not possible to execute the statement in which the cursor is without selecting the SQL text first (as this in the case, for example, in Oracle SQL Developer or TOAD with ctrl+enter).
If accidentally ctrl+shift+f was pressed, the so called Management Studio tries to write a *rpt file (save as box opens). This can be undone with a ctrl+d.

Keyboard shortcuts

Query output

ctrl+t write output as text. Same as menu Query -> Results To -> Results to Text
ctrl+d write output into grid. Same as menu Query -> Results To -> Results to Grid
ctrl+shift+f write result to file.
alt+break cancel a running query.
ctrl-alt-a starts the Activity Monitor

Object Explorer

Server Objects -> Linked Servers -> Providers: The list of OLE DB Providers that an SQL Server instance might access.
This list is maintained in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\instance name\Providers.

Activity Monitor

The activity monitor can be started with ctrl-alt-a, an icon in the menu bar or by right clicking on the instance in the Object explorer.

Menu Tools -> Options

The entries under the menu entry Tools -> Options are configured in the registry under HKEY_CURRENT_USER\SOFTWARE\Microsoft\SQL Server Management Studio\v.v_Config\ToolsOptionsPages.

Environment -> Keyboard

Environment -> Keyboard allows to assign keyboard shortcuts to commands.

Query Results -> SQL Server -> Results to Grid

Retain CR/LF on copy or save should be the default - but its not. After ticking this check box, SSMS must be restarted to take effect.

Menu Query

SQLCMD Mode

Using the Menu Query -> SQLCMD Mode allows to toggle sqlcmd mode.
If sqlcmd mode is toggled on, it allows to use such interesting features as variables (:setvar num 42 etc.).
Apparently, other features such as intellisense or the T-SQL debugger don't work with sqlcmd mode enabled. (But who cares about intellisense anyway…?)

Query Options

Under Results and Text, the size of the characters that are returned in a column can be adjusted. The default is 256, the maximum is only 8192, unfortunately.

TODO

SQL Server Management Objects (SMOs) allow to manage SQL Server programmatically.

See also

SQL Server
The installation directory of SQL Server Management Studio seems to be %ProgramFiles(x86)%\Microsoft SQL Server\nnn\Tools\Binn in which its executable Ssms.exe is found.
HKEY_CURRENT_USER\SOFTWARE\Microsoft\SQL Server Management Studio
%APPDATA%\Microsoft\SQL-Server-Management-Studio\14.0, %APPDATA%\Microsoft\SQL-Server-Management-Studio\18.0

Index