Re: ADO, SQLServer2000 and errors

From: Val Mazur (group51a_at_hotmail.com)
Date: 07/28/04


Date: Wed, 28 Jul 2004 00:06:04 -0400

Hi,

You need to set specific level of severity for the SP, to be able to see the
errors. Check next KB about it

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q194/7/92.ASP&NoWebContent=1

-- 
Val Mazur
Microsoft MVP
"Luigi" <Luigi@discussions.microsoft.com> wrote in message 
news:87A8672D-9A56-4EDE-9342-B567C1AE3B40@microsoft.com...
>I have a stored procedure in a SQL Server 2000 database that contains the 
>following code lines (@c is a varchar variable)
>
> 1 set @c = 'text data'
> 2 if (CAST(@c as int) = -1)
> 3 select '@c is -2'
> 4
> 5 select 'gone on after the error'
>
> If I execute the stored procedure in Query Analyzer what happens, as I 
> expected, is that an error is raised (with an error level of 16) and lines 
> 3 and 5 are not executed (I can't see the result of select statements in 
> the results pane of Query Analyzer).
>
> If I execute the stored procedure with and ADO.Command object, what 
> happens is that Command.Execute is executed without any error. I can't see 
> any entry in the Connection.Errors collection too.
>
> Is it correct ? I excpected an error reported also at client side by ADO.
> I'm using ADO 2.6 SP2 and SQL Server 2000 SP3a.
>
> Thank you very much for any help.
>
> Luigi 


Relevant Pages

  • RE: Differences in execution times for a stored procedure
    ... If OleDb, ... "Vincent Keller" wrote:> I am trying to execute a time-consuming stored procedure in my application. ... > Are there some known performance differences in executing a query directly through Query Analyzer and through ADO.NET? ...
    (microsoft.public.dotnet.framework.adonet)
  • Differences in execution times for a stored procedure
    ... I am trying to execute a time-consuming stored procedure in my application. ... When I run the stored procedure through Query Analyzer, ... Are there some known performance differences in executing a query (stored ...
    (microsoft.public.dotnet.framework.adonet)
  • xp_sendmail
    ... I'm running sql 2000 and when I execute xp_sendmail with the parameters in ... query analyzer I get the following error: ... Could not find stored procedure 'xp_sendmail'. ...
    (microsoft.public.sqlserver.tools)
  • export stored procedure to excel
    ... creates a crosstab and I can see the results of it when I ... execute it in query analyzer like so: ...
    (microsoft.public.sqlserver.programming)
  • RE: SQL stored procedure executing twice
    ... I wasn't aware that DLookupwould execute the "domain" more than once. ... caused the stored procedure to execute twice. ... Dim stDocName As String ... My pass-thru query properties ...
    (microsoft.public.access.modulesdaovba)