ADO, SQLServer2000, stored procedure and errors

From: Luigi (Luigi_at_discussions.microsoft.com)
Date: 07/27/04


Date: Tue, 27 Jul 2004 09:53:39 -0700

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: Execute Persmission denied on object sp_OACreate
    ... > SQL Server is creating a job behind the scenes. ... > permissions. ... > SA account password and gaining access to the database. ... >>> How can get a user permissions to execute these stored procedures ...
    (microsoft.public.sqlserver.security)
  • Re: Data migration questions?
    ... Use SSIS or the SqlBulkCopy class to import the data into SQL Server. ... Anyone who has read my books knows that I'm not in favor of including BLOBs in the database. ... "Mervin Williams" wrote in message ... should I use a DataSet to bring the data down to the local machine that will run the code and execute the transformation logic from it. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Problem with the Legacy ASP files and the Sql Server Express
    ... It looks like it is not going to be an easy job getting it to work on the SQL Server 2005 and Express:(. ... 'Then you can execute the command and then retrieve the ID ... I am 100% sure this code works against any version of SQL Server, as long as the connection is OK and the SP has two parameters @varCompany as Input and @Return_Value as Output. ... I do not think your problem is due to difference of SQL Server2000 and SQL Server2005, unless your stored procedure has some thing that only works in SQL Server2000, not SQL Server 2005. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: using sp_ as a naming convention for stored procedures
    ... System stored procedures are created and stored in the master ... database and have the sp_ prefix. ... from any database without having to qualify the stored procedure name fully ... SQL Server always looks for a stored procedure ...
    (microsoft.public.sqlserver.programming)
  • Re: Debug stored procedures with VB6
    ... > I can't see in the sql server analyser a tool to debug a stored procedure. ... > "Val Mazur" a écrit dans le message de ... >>>>> My database is installed locally. ...
    (microsoft.public.vb.database.ado)