By Default line numbers are NOT shown in Query pane in SSMS (2005) query window.
You need to follow below steps to Capture the line numbers in in Query plane. You can add / remove as per your requirement.
1. Select "Tool" from Menu bar, Now select "Options".
2. Then expand the "Text editor" option from appearing window.
3. Expand the "All language " option.
4. Finally Select the "General " option and place a check in the box "Line Number" in lower display screen.
Now when you open a new query window line numbers will appear. Reverse the steps for removing the line numbers.
You need to follow below steps to Capture the line numbers in in Query plane. You can add / remove as per your requirement.
1. Select "Tool" from Menu bar, Now select "Options".
2. Then expand the "Text editor" option from appearing window.
3. Expand the "All language " option.
4. Finally Select the "General " option and place a check in the box "Line Number" in lower display screen.
Now when you open a new query window line numbers will appear. Reverse the steps for removing the line numbers.