|
Posted by Erland Sommarskog on 09/07/06 21:36
(johnivey@gmail.com) writes:
> I have a large query that I am trying to debug in query analyzer.
> However, the errors I get have no line number or reference to where
> they are failing. How can I find out what line in the query is causing
> a particular error message to appear?
Errors usually come with a line number, and you can double-click on
the error message and be taken to the troublesome line.
Unfortunately, though, SQL Server's reporting of line numbers is often
inaccurate. Some errors are reported on the statement following the
statement with the error. If your error is incorrect column name or
table name, SQL Server will only point to where the query starts, which
is not very helpful for a 50-line query. (SQL 2005 does actually report
the exact line number in some of these situations, but not all.)
And if the error occurs during execution of the query, it's not really
sure that it would be meaningful with a line number within the query,
as the query is not processed line by line.
What error message do you get?
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|