Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    2

    Unanswered: returning temp tables, t-sql stored procedures

    Hi, im a bit of a beginner here and need to know how to call stored procedures from another sp and how can I return a temp table that I need to use in the calling sp's where clause?

    Some code would b great.

    Cheers

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    Are you looking for something like this?

    create proc proc2
    as
    insert #tmp
    select 1,'Q'
    go
    create proc proc1
    as
    create table #tmp(id int, code varchar(10))
    exec proc2
    select * from #tmp
    go
    exec proc1

    or

    alter proc proc2
    as
    select 1,'Q'
    go
    alter proc proc1
    as
    create table #tmp(id int, code varchar(10))
    insert #tmp
    exec proc2
    select * from #tmp
    go
    exec proc1

    or ?

  3. #3
    Join Date
    Oct 2003
    Posts
    2
    cheers thats all that is required

Posting Permissions

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