SSMS Show Line Numbers | SSMS Line Numbers
This article explains how to enable SSMS show line numbers.
SHOW Line Numbers in SQL Server Management Studio
As a developer you may have often encounter errors while debugging TSQL code. SQL Server will show you an error message referencing you to a particular line number where the syntax error has occurred. This tip explains How to Show Line Number feature in SQL Server Management Studio (SSMS). The step mentioned in this tip is applicable to all versions of SQL Server Management Studio starting SQL Server 2005.
Follow the simple steps mentioned in this article on How to Show Line Numbers in SQL Server Management Studio
Developers often encounters error in TSQL Code during development and this tip helps to Show Line Numbers in SQL Server or SSMS Show Line Numbers.
How to Display Line Numbers in SQL Server Management Studio (SSMS)
In SQL Server Management Studio (SSMS) by default display line number feature is disabled. However, you can easily enable this feature by following the steps mentioned in this tip.
1. Open SQL Server Management Studio. Click Tools ⇒ Options as shown in the below snippet.
2. In the Options dialog box on the left side pane expand the Text Editor and then expand Transact-SQL. Select General option as shown in the below snippet.
Top Trending SQL Server DBA and Developer Articles and Tips
- SQL Delete Duplicate Rows from a SQL Table in SQL Server
- How to Repair Suspect Database in SQL Server
- How to Enable Dedicated Administrator Connection in SQL Server
- How to Configuring Database Instant File Initialization Feature of SQL Server
- How to Backup and Restore Resource Database in SQL Server
- How to Start SQL Server in Single User Mode?
- How to Start SQL Server with Minimal Configuration
- How to Detect Virtual Log Files in SQL Server Transaction Log File
- How to Identify the Location of Resource Database in SQL Server
- How to Disable an Index in SQL Server
- How to Monitor Transaction Log File Usage in SQL Server
- How to Connect to SQL Server When all System Administrators are Locked Out
SSMS Show Line Numbers
3. In General Page, under Display select the Check Box next to Line Numbers as shown in the above snippet and click OK. Select “Word Wrap” option under Settings if you would like to wrap the TSQL code. This way to can enable SSMS Show Line Numbers Feature. Once you have enabled this feature in SSMS every time you open a New Query window it will Display Line Numbers.
Important Note: Whenever you encounter an error while running the TSQL Code you can double click the error message in the messages tab and SSMS takes you to the line which is wrongly written.
I recommend enable SSMS Show Line Numbers feature in SQL Server Management Studio as it helps to quickly move to the TSQL Code which is breaking.
- Recommend you to explore other features in SQL Server Management Studio.