Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2002
    Posts
    14

    Unanswered: select from a stored procedure

    how can I select from a stored procedures ?


    for example :

    select PROCEDURE_OWNER,PROCEDURE_NAME
    from sp_stored_procedures;

    what I need is to insert SP as part of a "select" statement
    so I can use it in cursor and/or join between SP and other tables

    10x in advance

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    You can't, unless you store the stored procedure result set in a table.

    Code:
    create table #TMP_sp_who(spid int, ecid int, status varchar(20), loginname varchar(30)
                           , hostname varchar(30), blk int, dbname varchar(15), cmd varchar(16))
    insert into #TMP_sp_who
    exec sp_who
    select * from #TMP_sp_who
    Paul Young
    (Knowledge is power! Get some!)

  3. #3
    Join Date
    Aug 2002
    Posts
    14
    10x

Posting Permissions

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