Have you ever written a long T_SQL statement that you are really proud of only to execute it and get an error on line 250? You then have to count from the first line down 250 or copy all of the code into an editor like UltraEdit to find the line the error occurred on? Wouldn’t it be easier if SSMS had a built-in line numbers to the Query editor? Well, the funny thing is they did, it is just not enabled by default. So how do we turn it on, let me show you quick.
Once the Options screen opens up, you will navigate down to find the Display settings.
Text Editor -> Transact-SQL -> General
Once you get here, enable the Line numbers check box and click ok.
Now when you open a new query in SSMS, you will see the line numbers! Super easy!