To enable line numbers in SQL Server Management Studio, click on the Tools menu and Options. In the left pane of the Options box, expand Text Editor and click on All Languages. On the right, under Display, you’ll see a check box for Line numbers. Check the check box to enable line numbers. I have uploaded a screenshot for reference. This was done in SSMS 2012.