Too many output returns?

  • I'm having some trouble figuring this one out...:

    The sproc is used to insert/update some data on the database,

    One part checks to see if an ID exists, if it does, it uses it, if it does not exist, then it adds it via another sproc stp_003_AddID @MyID Output, @spec, @desc

    The @MyID is used in a later part of the sproc to complete adding in the data.

    when the sproc ends it spits out both the @MyID (which I don't want it to do) and my Return Variable. I've used the SET NOCOUNT ON, and this has not resolved my issue.

    thanks for your time

    -- Francisco

  • hey francisco,

    can you please clarify the problem ...

    what do you mean by "when the sproc ends it spits out both the @MyID (which I don't want it to do) and my Return Variable" ?

    thanks

    jp

  • Sure, and I found the problem too ,

    the issue is this:

    the outer sproc takes parameters to insert/update a status on an ID. when the id does not originally exists, then in an IF statement it executes an addID sproc, which within it had a SELECT @myID

    At the end of the outer sproc I would return the status of either 1 or 0 for success, and it was spitting out instead both the @myID for new inserts and simply the result (1 or 0) when it was done.. I hadn't looked at the addID sproc in quite some time so ...

    -- Francisco

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

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