Stored Procedure - Expecting 2 input parameters - WHY??

  • I have a stored procedure where I would like to input ONLY 1 parameter, but when I execute the SP, it expects 2 parameters!  I don't know why!  I enter the CheckNum fine, but then it expects me to enter myRowCount as well, but isn't it an OUTPUT paramater:

    CREATE PROCEDURE dbo.spGetChecksByCheckNum

        (

            @CheckNum varchar(50),

            @myRowCount int output

       &nbsp

    AS

    SELECT CheckID, Vendor, Invoice, Amt, CheckNum, CheckAmt, Status FROM tblChecks INNER JOIN tblStatus ON tblChecks.StatusID = tblStatus.StatusID WHERE CheckNum = @CheckNum;

    /* @@ROWCOUNT returns the number of rows that are affected by the last statement. */

    SELECT @myRowCount=@@ROWCOUNT

    Hopefully someone can help me!

  • , you need to send in the output parameter for it to be output. Otherwise where does the output parameter go? It's not a return value, it's a parameter you pass in and will be passed back.

  • Steve Jones:

    I see now - I was using VS.NET 2003 to run the Stored Procedure and now that I set the VALUE for @RowCount to NULL, it works perfectly.  I now understand that it is expecting a parameter.

    Thanks a bunch!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply