Working with large sql statements, I find it is easier to have line numbers in the query window.
Enabling “Line numbers” process is the same with every version of SQL Server Management Studio since version that came with SQL Server 2005 (Version 9).
To enable line numbers in the query window:
1. Click on the Tools drop down menu
2. Click on the Options in the drop down menu
When the Options pop-up box opens:
1. Expand “Text Editor”
2. Expand “All Languages”
3. Click on the “General” option
4. Click in the “Line numbers” checkbox, and click the OK button of the Options pop-up box
Line numbers will be part of every current & new query window unless its undone.