Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002
    Location
    Brazil
    Posts
    2

    Smile Unanswered: Output Parameter from Stored Procedure to column Select


    I need that Output parameter from Stored Procedure returning to column Select, like a Function, for example:

    SELECT field1, field2, sp_calc_anything @param Output as field3
    from Table

  2. #2
    Join Date
    Jun 2002
    Location
    Turkey
    Posts
    1

    RE: Output Parameter from Stored Procedure to column Select

    You can do but you cannot do that from the way you want to be.

    You can do it with:

    DECLARE @ReturnedValue INT
    EXEC @ReturnedValue = spGiveValue
    SELECT
    YourOtherField,
    (@GaveValue) AS [Returned Value From SP]
    FROM
    YourTable

    spGiveValue source-code is:

    CREATE PROC
    spGiveValue
    AS
    RETURN (10)
    GO

    Good luck!

    --

    Frokrammer82

  3. #3
    Join Date
    Dec 2001
    Location
    Toronto, Canada
    Posts
    335
    Why don't you just use a FUNCTION ?
    MCDBA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •