Results 1 to 3 of 3

Thread: Stored Procedure Returns

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 1999
    Posts
    16

    Post

    I have a stored procedure that does a select and returns 0 or more rows as a result.

    How can I determine how many rows are returned from this stored procedure within another stored procedure?

    thx

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    Something like (although I haven't tested it) the following should work:

    Code:
    CREATE PROCEDURE rows_returned
     AS
       DECLARE @printline as CHAR(80)
    
       EXEC your_stored_procedure
       select @printline =  @@rowcount + " Rows selected"
       PRINT @printline
    [This message has been edited by JHausmann (edited 09-07-1999).]

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 1999
    Posts
    16

    Post

    Thanks, this works after putting a convert() around the @@rowcount when building the select for @printline.


Posting Permissions

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



Click Here to Expand Forum to Full Width