dbTalk Databases Forums  

SQL Server 2008 SSMS Error Line Numbers

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss SQL Server 2008 SSMS Error Line Numbers in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gene Wirchenko
 
Posts: n/a

Default SQL Server 2008 SSMS Error Line Numbers - 04-04-2011 , 10:04 PM






Dear SQLers:

Occasionally, I make an error and SSMS reports this.

Actually, I make a lot of them. There is a frustration that the
line number given by SSMS is rarely the line in my .SQL file since I
have a lot of GOs in it. I am putting together a simple database a
bit at a time, and I find it easier to drop it and restart on each
change so as to simplify debugging.

How do I find out the actual line number? If I am fortunate
enough to recognise the GO section where the error is, I can position
to the beginning and add the error line number given minus one to get
the actual line number. This is tedious. If I can not tell which GO
section met with disapproval, it is even worse. This is even more
tedious.

Please tell me that I am overlooking a setting. And what it is,
course. I will probably post the .SQL once I have finished. There
should be a few procedures in it worth snagging.

Sincerely,

Gene Wirchenko

Reply With Quote
  #2  
Old   
Henk van den Berg
 
Posts: n/a

Default Re: SQL Server 2008 SSMS Error Line Numbers - 04-05-2011 , 01:47 AM






With GO's intertwined in your .SQL file, I would recommend you debug the
..SQL by selecting the batches one at a time and execute the selection.
That works for me.

On 05-04-2011 05:04, Gene Wirchenko wrote:
Quote:
Dear SQLers:

Occasionally, I make an error and SSMS reports this.

Actually, I make a lot of them. There is a frustration that the
line number given by SSMS is rarely the line in my .SQL file since I
have a lot of GOs in it. I am putting together a simple database a
bit at a time, and I find it easier to drop it and restart on each
change so as to simplify debugging.

How do I find out the actual line number? If I am fortunate
enough to recognise the GO section where the error is, I can position
to the beginning and add the error line number given minus one to get
the actual line number. This is tedious. If I can not tell which GO
section met with disapproval, it is even worse. This is even more
tedious.

Please tell me that I am overlooking a setting. And what it is,
course. I will probably post the .SQL once I have finished. There
should be a few procedures in it worth snagging.

Sincerely,

Gene Wirchenko

Reply With Quote
  #3  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: SQL Server 2008 SSMS Error Line Numbers - 04-05-2011 , 02:32 AM



Gene Wirchenko (genew (AT) ocis (DOT) net) writes:
Quote:
How do I find out the actual line number? If I am fortunate
enough to recognise the GO section where the error is, I can position
to the beginning and add the error line number given minus one to get
the actual line number. This is tedious. If I can not tell which GO
section met with disapproval, it is even worse. This is even more
tedious.
Double-click on the error message, and SSMS will do the rest of the work for
you.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
  #4  
Old   
Henk van den Berg
 
Posts: n/a

Default Re: SQL Server 2008 SSMS Error Line Numbers - 04-05-2011 , 03:04 AM



DAMN! I've learned that a couple of months ago and I STILL forgot all
about it when I read this question.

Thanks for the slap over the forehead, Erland.

On 05-04-2011 09:32, Erland Sommarskog wrote:
Quote:
Gene Wirchenko (genew (AT) ocis (DOT) net) writes:
How do I find out the actual line number? If I am fortunate
enough to recognise the GO section where the error is, I can position
to the beginning and add the error line number given minus one to get
the actual line number. This is tedious. If I can not tell which GO
section met with disapproval, it is even worse. This is even more
tedious.

Double-click on the error message, and SSMS will do the rest of the work for
you.


Reply With Quote
  #5  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: SQL Server 2008 SSMS Error Line Numbers - 04-05-2011 , 02:47 PM



On Tue, 5 Apr 2011 07:32:27 +0000 (UTC), Erland Sommarskog
<esquel (AT) sommarskog (DOT) se> wrote:

Quote:
Gene Wirchenko (genew (AT) ocis (DOT) net) writes:
How do I find out the actual line number? If I am fortunate
enough to recognise the GO section where the error is, I can position
to the beginning and add the error line number given minus one to get
the actual line number. This is tedious. If I can not tell which GO
section met with disapproval, it is even worse. This is even more
tedious.

Double-click on the error message, and SSMS will do the rest of the work for
you.
Thank you. This will save me a lot of trouble.

While a useful thing, it is *not* obvious. Except by accident, I
doubt I would have ever tried clicking on text. Microsoft HCI expert,
please pick up a white courtesy phone...

Sincerely,

Gene Wirchenko

Reply With Quote
  #6  
Old   
Henk van den Berg
 
Posts: n/a

Default Re: SQL Server 2008 SSMS Error Line Numbers - 04-05-2011 , 02:56 PM



On 05-04-2011 21:47, Gene Wirchenko wrote:

Quote:
Thank you. This will save me a lot of trouble.

While a useful thing, it is *not* obvious. Except by accident, I
doubt I would have ever tried clicking on text. Microsoft HCI expert,
please pick up a white courtesy phone...
I highly agree with you Gene.

Still, it's mentioned in the help though. (Not that I would ever have
found it if I didn't look specifically for "error line")

FWIW, here's the location:
ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_5techref/html/fae6327d-e268-44ae-a474-4a8f8f843129.htm

Best,
Henk

Reply With Quote
  #7  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: SQL Server 2008 SSMS Error Line Numbers - 04-05-2011 , 03:44 PM



Gene Wirchenko (genew (AT) ocis (DOT) net) writes:
Quote:
While a useful thing, it is *not* obvious. Except by accident, I
doubt I would have ever tried clicking on text. Microsoft HCI expert,
please pick up a white courtesy phone...
Dunno. It is certainly not the only environment where you can do this. In
fact, I would go crazy if I came to environment where something like this
was not available. But of course, if you have never seen the metaphor, it
may not be that obvious to try.

--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.