Re: Line numbers returned by Query Analyzer on sql errors
From: David Gugick (davidg-nospam_at_imceda.com)
Date: 10/15/04
- Next message: JAD: "Files sizes in a OLE bmp field"
- Previous message: sql beginner: "Re: How to create table from existing table structure?"
- In reply to: Stephen Ahn: "Line numbers returned by Query Analyzer on sql errors"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 15 Oct 2004 10:40:57 -0400
Stephen Ahn wrote:
> Using SQL server version 8.00.760
> Given two scripts :
>
> Script A :
> ==
> print 'xyz'
> exec dbo.doh
> ==
>
> Assuming stored proc 'doh' does not exist, when
> I run the above as one batch in Query Analyzer,
> I get the result :
> ==
> xyz
> Server: Msg 2812, Level 16, State 62, Line 2
> Could not find stored procedure 'dbo.doh'.
> ==
>
> Now Script B :
> ==
> print 'abc'
> select * from doh
> ==
>
> Assuming table 'doh' does not exist, I get :
> ==
> abc
> Server: Msg 208, Level 16, State 1, Line 1
> Invalid object name 'doh'.
> ==
>
>
> The line number reported for the error in script A is :
> 'Line 2', which make sense, but the
> line number reported in script B is 'Line 1',
> which seems strange.
>
> Can anyone shed any light into this ?
> Thanks,
> Stephen
Run those statements in Profiler using SQL:StmtStarting/Completed,
SQL:BatchStarting/Completed, SP:Stating/Completed,
RPC:StartingCompleted, and SP:StmtStartingCompled and see of the results
shed some light on your question.
-- David Gugick Imceda Software www.imceda.com
- Next message: JAD: "Files sizes in a OLE bmp field"
- Previous message: sql beginner: "Re: How to create table from existing table structure?"
- In reply to: Stephen Ahn: "Line numbers returned by Query Analyzer on sql errors"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|