Color Coding in Query Editors


Applies To: SQL Server 2016

The text entered in the code editors is assigned a category; each category is identified by a color. The colors help you quickly find text in your code. For example, comments stand out in dark green. The following table lists the most common colors. You can view the whole list of colors and their categories, and configure a custom color scheme by using the Tools, Options menu. For more information about how to change the default colors, see Change Font Color, Size, and Style.

RedSQL string
Dark greenComment
Black on silver backgroundSQLCMD command
MagentaSystem function
GreenSystem table, view, or table-valued function. Also, the system schemas sys and INFORMATION_SCHEMA.
TealLine numbers or template parameter
MaroonSQL Server stored procedure
Dark grayOperators

You can configure registered servers or Database Engine servers in Object Explorer to have different colors in the Database Engine Query Editor status bar. This helps you identify which server each editor window is connected to when you have many windows open at the same time. For more information about setting status bar colors, see Status Bar (Database Engine Query Editor).

Some types of editors do not display the status bar, or do not support multiple colors.

Community Additions