Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Tips Database Forum Rss Feed

» Database Journal Home
» Database Articles
» Database Tutorials
MS Access
SQL Scripts & Samples
» Database Forum
» Slideshows
Free Newsletters:

News Via RSS Feed

Rss Feed

Database Journal |DBA Support |SQLCourse |SQLCourse2

Featured Database Articles

Database User and Programming Tips

Posted September 4, 2018

Line Numbers in SQL Server Management Studio

By Greg Larsen

Have ever tried to debug a chunk of TSQL code (like a stored procedure) and found yourself trying to figure out which TSQL statement is at a particular line number?  By default, SQL Server Management Studio (SSMS) doesn’t display numbers.  But that is only the default, you can change it.

To allow your Query window to display line numbers all you need to do is go to the “Tools” item on the menu and then click on the “Options…” item:


When you do that the “Options” screen will be displayed.  On this screen expand the “Text Editor” item, the “All Languages” item, then the “General” item.  Under the “Settings” item enable the line numbers, by checking the “Line numbers” item.  To save this setting click on the “OK” button.

Options Screen
Options Screen

By doing the above you will now get line numbers in all of your query windows that are open, or any  new query windows that you might open. 

See all articles by Greg Larsen

Database User and Programming Tips Archives