Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Posts
    3

    Unanswered: Supress return results from exec sp call from another sp

    exec @hrs2 = tt_sum_hrs @num, @day2

    Hi I'm calling a stored proc from within another and the called proc is returning an int value into my varible, @hrs2, just fine; but my results from the containing sp include all the values from the called one within; how can I supress the return of the called sp results in my container sp results?


    Thanks for any tips!

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    I'm sorry, could you clarify that?

    Maybe some sample code and result sets?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Feb 2002
    Posts
    2,232
    It sounds like you need to use:

    set nocount on and/or set fmtonly on

  4. #4
    Join Date
    Nov 2003
    Posts
    3
    Originally posted by rnealejr
    It sounds like you need to use:

    set nocount on and/or set fmtonly on
    thnks, but I tried those and it still returns the column info,"(no column name" which messes up my data bind. Again the call is made within another sp to populate the int variable @hrs2:

    exec @hrs2 = tt_sum_hrs @num, @day2

    Then that value is used to update a temp table; then I do a select all from the temp table and my results are the returned int with "no column name" (<don't want this) and then the temp table contents, which is all that I want

    Here's the stored proc that is called:

    ALTER PROCEDURE TT_sum_hrs
    ( @num int, @day as varchar(20))

    as

    declare @sql as nvarchar(250)

    select @sql=('select sum('+quotename(@day)+') from #pso_view where date = ')
    select @sql= @sql+cast(@num as varchar(5))


    EXEC sp_executesql @sql

    Thanks Again!

Posting Permissions

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