Skip to content

Commit 789087a

Browse files
committed
Fix typos and wrong anchor links
1 parent 2800df4 commit 789087a

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

SSMS/SSMS_Tips/README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ Also you can activate multi line mode with `Shift + Alt` keys and using keyboard
112112

113113

114114
<a id="6"></a>
115-
a>
116115
## Script Table and Column Names by Dragging from Object Explorer
117116
Save keystrokes by dragging
118117
Drag the `Columns` folder for a table in to auto-type all column names in the table in a single line.
@@ -122,7 +121,6 @@ Drag the `Columns` folder for a table in to auto-type all column names in the ta
122121

123122
<a id="7"></a>
124123
## Disable Copy of Empty Text
125-
<a id="8"></a>
126124

127125
- Select a block of text to copy;
128126
- Move the cursor the place where you want to paste the code;
@@ -132,7 +130,7 @@ Drag the `Columns` folder for a table in to auto-type all column names in the ta
132130
This behavior can be disabled in SSMS: go to `Tools > Options > Text Editor > All Languages > General > 'Apply Cut or Copy Commands to blank lines when there is no selection'` and uncheck the checkbox.
133131

134132

135-
<a id="9"></a>
133+
<a id="8"></a>
136134
## Client Statistics
137135
When you enable that option for your session, SQL Server Management Studio will give you more information about the client side processing of your query.
138136

@@ -149,7 +147,7 @@ The Time Statistics additionally shows you the following information:
149147
- Wait Time on Server Replies
150148

151149

152-
<a id="10"></a>
150+
<a id="9"></a>
153151
## Configure Object Explorer to Script Compression and Partition Schemes for Indexes
154152
Is this index compressed or partitioned?
155153

@@ -163,7 +161,7 @@ You can make sure you’re aware when indexes have compression or are partitione
163161
- Click OK
164162

165163

166-
<a id="11"></a>
164+
<a id="10"></a>
167165
## Using GO X to Execute a Batch or Statement Multiple Times
168166
The `GO` command marks the end of a batch of statements that should be sent to SQL Server for processing, and then compiled into a single execution plan.
169167
By specifying a number after the ‘GO’ the batch can be run specified number of times. This can be useful if, for instance, you want to create test data by running an insert statement a number of times. Note that this is not a Transact SQL statement and will only work in Management Studio (and also SQLCMD or OSQL). For instance the following SQL can be run in SSMS :
@@ -180,7 +178,7 @@ This will run the insert statement 10 times and therefore insert 10 rows into th
180178
In this case this is a simpler alternative than creating a cursor or while loop.
181179

182180

183-
<a id="12"></a>
181+
<a id="11"></a>
184182
## SSMS Template Replacement
185183
One under-used feature of Management Studio is the template replacement feature. SSMS comes with a library of templates, but you can also make your own templates for reusable scripts.
186184

@@ -189,7 +187,7 @@ In your saved .sql script, just use the magic incantation to denote the paramete
189187
Then, when you open the `.sql` script, you hit `CTRL + Shift + M`, and SSMS will give you a pop-up to enter your replacement values
190188

191189

192-
<a id="13"></a>
190+
<a id="12"></a>
193191
## Color coding of connections
194192
SQL Server Management Studio has the capability of coloring the bar at the bottom of each query window, with the color dependent on which server is connected.
195193
This can be useful in order to provide a visual check of the server that a query is to be run against, for instance to color code production instances as red, development as green and amber as test.
@@ -198,13 +196,13 @@ To add a color bar when connecting to the server click on the Options button in
198196
Select the check box towards the bottom of the window and use the ‘Select…’ button to choose a color.
199197

200198

201-
<a id="14"></a>
199+
<a id="13"></a>
202200
## SQLCMD mode
203201
Switching on SQLCMD mode enables a number of useful extra scripting style commands in SSMS.In particular you can use it to change to the connection credentials within the query window, so that you can run a query against multiple servers from the same query window.
204202
There are more details of how to do this here: [Changing the SQL Server connection within an SSMS Query Windows using SQLCMD Mode](http://www.sqlmatters.com/Articles/Changing%20the%20SQL%20Server%20connection%20within%20an%20SSMS%20Query%20Windows%20using%20SQLCMD%20Mode.aspx)
205203

206204

207-
<a id="15"></a>
205+
<a id="14"></a>
208206
## Script multiple objects using the Object Explorer Details Windows
209207
Individual database objects, such as a table or stored procedure, can be scripted within SSMS by right clicking on the object within Object Explorer and selecting the appropriate item in the drop down menu.
210208
However if you have a lot of objects to script that can quickly become time consuming.
@@ -215,7 +213,7 @@ A list of all tables appears in the Object Explorer Details window.
215213
Select the tables you want to script (using the Control key if necessary) and then right click and select which script option you want – e.g. to create a table create script for all tables
216214

217215

218-
<a id="16"></a>
216+
<a id="15"></a>
219217
## Registered Servers / Central Management Server
220218
If you have a lot of servers then re-entering the details in Object Explorer every time you start SSMS can be frustrating and time consuming.
221219
Fortunately there are two facilities within SSMS that enable these details to be entered just once and “remembered” each time you open up SSMS.
@@ -233,7 +231,7 @@ Central Management Server are similar to Registered Servers but with some differ
233231
A significant limitation with CMS is that the CMS server itself can’t be included in the list of servers.
234232

235233

236-
<a id="17"></a>
234+
<a id="16"></a>
237235
## Splitting the Query Window
238236
The query window in SSMS can be split into two so that you can look at two parts of the same query simultaneously.
239237
Both parts of the split window can be scrolled independently. This is especially useful if you have a large query and want to compare different areas of the same query.
@@ -242,22 +240,22 @@ To split the window simply drag the bar to the top right hand side of the window
242240
The splitter bar allows you to view one session with two panes. You can scroll in each pane independently. You can also edit in both the top and bottom pane
243241

244242

245-
<a id="18"></a>
243+
<a id="17"></a>
246244
## Moving columns in the results pane
247245
It may not be immediately obvious but you can switch columns around in the results pane when using the grid view, by dragging the column headers and dropping them next to another column header.
248246
This can be useful if you want to rearrange how the results are displayed without amending the query, especially if you have a lot of columns in your result set.
249247
This works only for one column.
250248

251249

252-
<a id="19"></a>
250+
<a id="18"></a>
253251
## Generating Charts and Drawings in SQL Server Management Studio
254252
You don't have to settle for T-SQL's monochrome text output. These stored procedures let you quickly and easily turn your SELECT queries' output into colorized charts and even computer-generated art.
255253
To turn your own data into a line, column, area, or bar chart using the Chart stored procedure, you need to design a SELECT query that serves as the first parameter in the stored procedure call.
256254

257255
Detailed Article and code here: [Generating Charts and Drawings in SQL Server Management Studio]
258256

259257

260-
<a id="20"></a>
258+
<a id="19"></a>
261259
## Additional Connection Parameters
262260
One such change SSMS got for free is the connection resiliency logic within the SqlConnection.Open() method.
263261
To improve the default experience for clients which connect to Azure SQL Database, the above method will (in the case of initial connection errors / timeouts) now retry 1 time after sleeping for 10 seconds. These numbers are configurable by properties called ConnectRetryCount (default value 1) and ConnectRetryInterval (default value 10 seconds.)
@@ -269,12 +267,12 @@ ConnectRetryCount=0
269267
```
270268

271269

272-
<a id="21"></a>
270+
<a id="20"></a>
273271
## Working with tabs headers
274272
You can view [SPID](https://docs.microsoft.com/en-us/sql/t-sql/functions/spid-transact-sql) in tabs header, quickly script open containing folder or copy script file path.
275273

276274

277-
<a id="22"></a>
275+
<a id="21"></a>
278276
## Hiding tables in SSMS Object Explorer
279277
1. You can actually hide an object from object explorer by assigning a specific extended property:
280278
```

0 commit comments

Comments
 (0)