• I ran the following in Query Analyzer:

    CREATE PROCEDURE spTest1

    AS

    SELECT * FROM NoTable

    RETURN 1

    GO

    DECLARE @v-2 int

    exec @v-2 = spTest1

    PRINT @v-2

    And I got the following error:

    Server: Msg 208, Level 16, State 1, Procedure spTest1, Line 4

    Invalid object name 'NoTable'.

    From this I would say that if the execution of a stored procedure abruptly and completely halts then you will not get a return code, unless of course things happen differently with ADO.

    I'll say right now I know almost nothing about ADO. I also know very little VB. The closest I get to that is VB scripts in DTS packages. From my knowledge of SQL, it looks to me as if you should be able to get the return code from the SP as long as it doesn't halt as in the example above.

    Robert W. Marda

    SQL Programmer

    bigdough.com

    The world’s leading capital markets contact database and software platform.

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems