Mitch’s Quick Tips – #1 Adding Line Numbers in SSMS

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.

Within the SQL 2012 SSMS window, click on Tools -> Options…
SSMS_LineNum_1

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.

SSMS_LineNum_2

Now when you open a new query in SSMS, you will see the line numbers! Super easy!

SSMS_LineNum_3

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s