Use Line Numbers in SSMS

Use Line Numbers in SSMS

One of the first things I do when setting up a new instance of SQL Server Management Studio is to enable line numbers in my query editor

As your SQL scripts get longer, having the ability to quickly and easily find a specific row in the code can be a real time saver

Within SQL server management studio, you can enable line numbers to be shown which makes it easier when you need to debug code or just to navigate through long SQL scripts

How to enable line numbers in SQL Server Management Studio

Tools ==> Options

Text Editor ==>

Transact SQL ==> General

Then select the option for line numbers in the settings box

SQL Server Management Studio Options screen to enable line number in the SQL editor

The editor window now shows line numbers on the left hand side

SQL Editor screen showing lines of code with line numbers


Quickly Go To a Line

With line numbers enabled you can make better use of features like ‘Go To Line’

CTRL + G, brings up the Go To Line dialogue box, enter the line number you want and press OK

No alt text provided for this image

Or you can use Edit, Go To, Go To Line to bring up the same dialogue box

Enable line numbers on your SQL editor, its quick and easy and makes navigating through code a lot easier

For more tips subscribe to this blog or visit our You Tube Channel

#SQL #SQLTIPS #SQLLineNumbers

要查看或添加评论,请登录

Select Distinct的更多文章

社区洞察

其他会员也浏览了