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 2000 Forums
 SQL Server Development (2000)
 Interpreting lines in errors

Author  Topic 

Marioi
Posting Yak Master

132 Posts

Posted - 2005-12-01 : 15:44:41
I write sProcs and UDFs in QA typically in 3 batches:

IF EXISTS ... DROP PROCEDURE
GO
CREATE PROCEDURE
GO
-- Run the procedure
GO

When I get an error like this:

Server: Msg 170, Level 15, State 1, Line 6
Line 6: Incorrect syntax near '.'.


how should I interpret which batch generated it? I've been adding a hard return under each GO from bottom up and rerunning the code to see the last batch that caused the 'Line' to change.

Is there a way to see line numbers in code more easily than mentally deducting from the line number on the status bar the line number of the GO statement above the batch?

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2005-12-01 : 15:51:39
Double clicking the error (in the results pane) usually takes me to the problem area. Slapping in some PRINT statments in strategic places also helps to see where the errors happen.

Be One with the Optimizer
TG
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-02 : 00:45:27
http://www.sommarskog.se/error-handling-I.html

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -