Enhanced ScrollBar In SQL Server 2016

Introduction

If you have used Visual Studio, this is not a new feature. If you have already noticed the splash screen that appears at the time of opening SSMS, you might have seen the bottom line “Powered by Visual Studio”. It means one should not be surprised to see the IDE features of Visual Studio, which is making its way to SSMS gradually as SSMS is now built upon Visual Studio isolated Shell.

How does it happen

Follow the steps to open the configuration Window.

Tools > Options > Text Editor > All Languages > Scroll Bars. You shoud get a Window, as shown below.



Before we discuss further, let’s understand what Annotation means.

Annotations

In SSMS, Annotations on the vertical scroll bar are the visual indications/symbols to have a bird's eye view of the change made to the current query Window. These are small color markers on the vertical scroll bar, which indicate various things like breakpoint, current caret position, errors, code changes etc. You can easily navigate to these positions of your query by scrolling down to the marked positions. This feature is particularly very helpful when you are writing/editing a long query/stored proc/function etc.

You can hide/show the horizontal and vertical scroll bars, using the first two checkboxes in this screen. Now, there are two distinct sections i.e. Display & Behavior. The Display section is all about customizing what Annotations;you want to show or hide on the vertical scroll bar. The default is all the Annotations are enabled. The second section i.e. Behavior section is about configuring different behaviors of the scroll bar such as width, mode etc.
Let’s understand what each of these elements are for.

(Note- The number in the numbered list corresponds to the number in the picture given above i.e. figure-1).
  1. Show annotations over vertical scroll bar



    By default, all its sub elements are set to show on the scroll bar in SSMS 2016 in addition to it. Hence, without making any changes, you should be able to see these color marks. Unchecking it will disable all the Annotations on the scroll bar.

  2. Show changes

    When this is enabled, you should be able track the changes done i.e. which portion of the query is saved and which portion has been changed after the last save. You may refer to the image on the right side, where the Green colored portion marked with “a” is the section which is already saved and the portion with Yellow color and marked by “b” is the portion, which is changed after the last save.

  3. Show marks

    Shows the marks for breakpoints and bookmarks when enabled, as shown in the image given above, which is marked with “c” in Maroon color, which indicates the breakpoint while “d” in Black color, which is the indication of the position of the bookmark.

  4. Show errors

    It indicates the positions of the errors, if any, in the current query Window. The red colored mark, “e” is an example of such.

  5. Show caret position

    Shows the current position of the caret marked as a single horizontal line over the vertical scroll bar in the above image as “f”.

  6. Use bar mode for vertical scroll bar

    This is the default behavior, which you will see in SSMS. This is the old vertical scroll bar with Annotations.

  7. Use map mode for vertical scroll bar

    With this mode, you can customize the vertical scroll bar to different width and can preview the code by just hovering over the vertical scroll bar.

  8. Show preview tooltip



    When this is enabled, you will be able to preview the code like a tooltip when you hover the mouse pointer over the vertical scroll bar at the respective positions as the image on the right side.

  9. Source overview

    You can see the code overview on the scroll bar by customizing the width to the available options, as shown in figure 1

    1. Off
    2. Narrow
    3. Medium
    4. Wide

Conclusion

I hope this little tip on SSMS will be of great help. Please share your valuable thoughts on this.

Thanks for reading.

Ebook Download
View all
Learn
View all