stored procedure resul set

  • hi all,

    I m having a stored procedure which returns two result sets based on the success or failure.

    Resut set for success contains :name,id,status

    Result set for failure :error_id,error_desc,appl

    I m using the following query to get the result of the stored procedure .It returns 0 for success and -1 for failure.

    declare @ret int

    DECLARE @Tmp TABLE

    (

    name CHAR(70),

    id INT,

    status char (1)

    )

    insert into @Tmp

    EXEC @ret = sptest '100','King'

    select @ret

    select * from @Tmp

    If the procedure is success i m getting the value in the temp table.If it fails i m getting a error like

    "Insert Error: Column name or number of supplied values does not match table definition."

    Can some one pls help me to handle both the result sets.

  • This post is in the wrong forum. It should be in the T-SQL Forum, not SSIS. Ask the moderator to move it.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

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

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