How to display line numbers in Visual Studio and SQL Server

When you install the Visual Studio and SQL Server for the first time, code editors are not enabled with line numbers by default.

Line numbers allows the developers to easily focus and move to particular line of code.

Here I am going to show you a tip for beginners on how to enable the line numbers in both Visual Studio 2015 and SQL Server 2014.

Visual Studio

In Visual Studio you can enable the line numbers either by program language (C#, JavaScript, HTML etc.) or for all the languages supported by Visual Studio.

Go to Visual Studio -> on the menu bar select Tools menu -> choose Options menu item

You will get an Options dialog. Now expand the Text Editor node

If you want to enable the line numbers for all the languages supported by Visual Studio then select the All Languages node under the Text Editor and check the Line numbers checkbox in right side options as shown below:
Visual Studio display or enable line numbers

If you want to enable the line numbers for only specific language like C# then select the language node which you prefer under the Text Editor and check the Line numbers checkbox in right side options as shown below:
Visual Studio display or enable line numbers for specific language

Finally click on OK button on the dialog. Now you can see the line numbers are enabled on your code editor as shown below:
Visual Studio Code Editor with line numbers

SQL Server

In SQL Server, enabling the line number to T-SQL query editor is very similar to doing in Visual Studio.

In SQL Server you can enable the line numbers either by program language (Transact-SQL, XML, etc.) or for all the languages supported by the SQL Server.

Go to SQL Server -> on the menu bar select Tools menu -> choose Options menu item

If you want to enable the line numbers for all the languages supported by SQL Server then select the All Languages node under the Text Editor and check the Line numbers checkbox in right side options as shown below:
SQL Server display or enable line numbers

If you want to enable the line numbers for only specific language like Transact-SQL then select the language node which you prefer under the Text Editor and check the Line numbers checkbox in right side options as shown below: 
SQL Server display or enable line numbers for specific language

Finally click on OK button on the dialog. Now you can see the line numbers are enabled on your T-SQL editor as shown below:
SQL Server T-SQL editor with line numbers

Hope you got a tip on displaying the line numbers in both Visual Studio code editor and SQL Server T-SQL editor. Thanks for reading.

No comments:

Powered by Blogger.