Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to insert line number in query window?

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2009-04-03 : 12:26:54
How to insert line number in query window so that it is easy to find out error?

Wozer
Starting Member

29 Posts

Posted - 2009-04-03 : 12:41:36
If you Click on a line it will show the line number in the bottom right of SSMS

it will look like

Ln *** Col ** Ch ** INS


I'm not sure if you can put it into the query window
Go to Top of Page

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2009-04-03 : 12:42:47
you can use a row_Number()


Select row_number() over (order by (Select 1)),*
from
mytable



Success is 10% Intelligence, 70% Determination, and 22% Stupidity.
\_/ _/ _/\_/ _/\_/ _/ _/- 881
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-04-03 : 12:56:47
Select Tool | Options.
Expand Text Editor in the Options Tree and select All Languages.
In the property pane on the right, select the Line Numbers check box under the Display heading.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-04-03 : 12:58:27
In SQL SERVER Management Studio
Menu: Tools --> Options --> Text Editor --> All Languages --> mark the Box "Line numbers"

Greetings
Webfred


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-04-03 : 12:59:52
Oops toooooooo late....


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -