Display Line Numbers in a SQL Server Management Studio Query Window (SSMS)


Sometimes when we encounter an error message for a T-SQL query while debugging. The SQL Server shows the error message along with the line number where the error has occurred. In this article, I will give a simple tip to enable the Line Number feature in SSMS. This feature is applicable to all versions of SSMS starting from SQL Server 2005.

Note: By Default in SSMS display line number is DISABLED.

Display Line Numbers in SQL Server Management Studio (SSMS)

  • Open SSMS. Click Tools and navigate to Options (Tools -> Options).
Fig. Tools -> Options
  • In the Options dialog box on the left side pane expand the Text Editor and then expand Transact-SQL
Fig.2 Text Editor Option
  • In General options, under Display  section, Check the Check Box next to Line Numbers as shown in the above and click OK.
Fig.3 Line Numbers in SSMS Query Window


Thus we can display line numbers in SSMS Query Window. I assume this tip was very useful to you all. Please share your feedback in the comment section.

Consider to read other articles from me in SQL Server,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Website Built with WordPress.com.

Up ↑

%d bloggers like this: