Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
SQL Server
Azure SQL Database
Azure SQL Managed Instance
Azure Synapse Analytics
Analytics Platform System (PDW)
With the Editor you can format your code with indenting, hidden text, URLs, and so forth. You can also autoformat your code as you type by using smart indenting.
Indenting
You can choose three different styles of text indenting. You can also specify how many spaces compose a single indentation or tab, and whether the Editor uses tabs or space characters when indenting.
Choose an indenting style
On the Tools menu, select Options.
Select Text Editor.
Select the folder, and select All Languages to set indenting for all languages.
Select Tabs.
Select one of the following options:
- None. The cursor goes to the beginning of the next line.
- Block. The cursor aligns the next line with the previous line.
- Smart (Default). The language service determines the appropriate indenting style to use.
Some languages don't offer all three indenting options.
Change indent tab settings
On the Tools menu, select Options.
Select Text Editor.
Select the folder for All Languages to set indenting for all languages.
Select Tabs.
To specify tab characters for tab and indent operations, select Keep tabs. To specify space characters, select Insert spaces.
If you select Insert Spaces, enter the number of space characters each tab or indent represents under Tab Size or Indent Size, respectively.
Indent code
Select the text you want to indent.
Press TAB, or select the Indent button on the Standard toolbar.
Unindent code
Select the text you want to unindent.
Press Shift+Tab, or select the Unindent button on the Standard toolbar.
Automatically indent all of your code
On the Tools menu, select Options.
Select Text Editor.
Select All Languages.
Select Tabs.
Select Smart.
Note
The Smart option isn't available for some languages.
Convert white space to tabs
Select the text whose white space you want to convert to tabs.
On the Edit menu, point to Advanced, and select Tabify Selection.
Convert tabs to spaces
Select the text whose tabs you want to convert to spaces.
On the Edit menu, point to Advanced, and select Untabify Selection.
The behavior of these commands depends on the tab settings in the Options dialog box. For example, if the tab setting is 4, Tabify Selection creates a tab for every 4 contiguous spaces, and Untabify Selection creates 4 spaces for every tab.
Convert text to upper and lower case
You can use commands to convert text to all uppercase or lower case.
Switch text to upper or lower case
Select the text you want to convert.
To convert text to uppercase, press Ctrl+Shift+U, or select Make Uppercase on the Advanced submenu of the Edit menu.
To convert text to lowercase, press Ctrl+Shift+L, or select Make Lowercase on the Advanced submenu of the Edit menu.
Note
For a complete list of keyboard shortcut keys, see SQL Server Management Studio keyboard shortcuts.
Display and link to URLs
You can create and display selectable URLs in your code. By default, the URLs:
Are underlined.
Change the mouse pointer to a hand when you move over them.
Open the URL when selected, if the URL is valid.
Display a selectable URL
On the Tools menu, select Options.
Select Text Editor.
To change the option for only one language, select that language folder and then select General. To change the option for all languages, select All Languages and then select General.
Select Enable single-click URL navigation.