SQL Server Management Studio: How to Add Line Numbers

SQL Server Management Studio: How to Add Line Numbers

I have seen many times in MSDN SQL Server Tools Forum forum users asking how to add line numbers in SSMS or how to count the number of lines of code.

In SQL Server Management Studio there is a provision to add line numbers and it is really simple to add.

In SSMS, Goto Tools - > Options ... -> Text Editor - > Transact - SQL - > General - > Display - > Line numbers (check this option to display line numbers on Query window)



Once line numbers are added, if you have T-SQL code of 1000 lines or more on your query window, the shortcut key to go particular line number is CTRL + G
If you notice at the bottom of SSMS, you can see Ln (N), where N denotes the line number of current cursor position (as highlighted in below screenshot)

Leave a Comment
  • Please add 5 and 5 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Naomi  N edited Original. Comment: Minor edit

Page 1 of 1 (1 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Naomi  N edited Original. Comment: Minor edit

Page 1 of 1 (1 items)