In this SQL Server tutorial, we will learn how to show or view line numbers in SQL Server Management Studio. And we will illustrate all the steps required to view line numbers in SQL Server Management Studio.
View line numbers in SQL Server Management Studio
SQL Server Management Studio is a prominent database management system developed by Microsoft (Multinational technology corporation located in the United States). It is a high-level development environment for configuring, managing, and administering SQL Server components.
Also, check How to install SQL Server Management Studio 2019 on Windows 10.
Now, whenever we receive an error message from SQL Server, it refers to a certain line number in our query. However, finding the line number where the syntax mistake occurred is a little frustrating. So, to overcome these issues, we’ll look at how to enable the line number functionality in SQL Server Management Studio.
Let’s understand the steps required to enable this functionality in the management studio.
Step-1
First, open the SQL Server Management Studio in your system, and then, select the Tools from the menu bar and click on Options. And this will open an Options dialog box.

Step-2
On the Options dialog box, first, expand the Text Editor option from the left side panel then expand the Transact-SQL option. After this, click on the General option, and it will open the general tab on the right-side panel.

Step-3
Now, from the right panel, move the to Settings section and tick mark the Line numbers option. And then, click on the OK button.

So, with this, we have enabled the line numbers functionality in SQL Server Management Studio. And to test the result, we can open a new or existing query editor page.

Also, check: SQL Server logical operators
Disable view line numbers in SQL Server Management Studio
Now, to disable the line numbers functionality in SQL Server Management Studio, we can use the same steps.
- First, select the Tools from the menu bar and click on Options.
- Next, expand the Text Editor and Transact-SQL option and click on the General tab.
- After this, under settings, uncheck the Line Numbers check box. In the end, click on the OK button.
So, in this tutorial, we have learned how to view line numbers in SQL Server Management Studio. Moreover, we have also covered how to disable the view line numbers in SQL Server Management Studio.
You may also like to read the following SQL Server tutorials.
- Arithmetic operators in SQL Server
- Introduction to SQL Server Trigger
- SQL Server String_agg
- Full-text search in SQL Server
- SQL Server User Permissions
- View in SQL Server
- SQL Server Trigger on Delete Insert Into Another Table
- SQL Server stored procedure vs function
- Stored procedure in SQL Server
I am Bijay having more than 15 years of experience in the Software Industry. During this time, I have worked on MariaDB and used it in a lot of projects. Most of our readers are from the United States, Canada, United Kingdom, Australia, New Zealand, etc.
Want to learn MariaDB? Check out all the articles and tutorials that I wrote on MariaDB. Also, I am a Microsoft MVP.