Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

who can solve this problem is professional in sql database

rezaab2002rezaab2002 Member Posts: 26
I have to stored procedures named : sp1 and sp2

sp1 return a collection of data .

I want to call sp1 inside sp2 and get it's data and work around it .

sp1 source ( something like this ) : select * from table1

sp2source ( something like this ) :

exec (sp1) ====> here i want to get data

how is that possible .

thanks alot .



Comments

  • WEBMASTERWEBMASTER Member Posts: 549
    In SQL Server 2005.

    Could you not define a temporary table in memory like


    declare @MyTempTable table (ID int NOT NULL,..... )

    then

    use SP1 to insert data into @MyTempTable?

    like INSERT INTO @MyTempTable (ID......)


    I have used this technique to first load some data into a temp table and then run a a few queries against it.



    Tore Nestenius
    [blue][italic][b]/WEBMASTER[/b][/italic][/blue] Programmers Heaven

Sign In or Register to comment.