SQL SERVER 2005- How to call nested stored procedure and save the output in Temporary Table

Well, I have to create a procedure which calls nested procedures to reduce the work again and store the output of the nested stored procedure in the temporary table.
Here are the few steps taken by me to achieve this task
Suppose you have stored procedure named sp_FirstProcedure and sp_SecondProcedure

As I have move my blog from here please visit for detail.

http://blog.joggee.com/?p=24

for future reference

http://blog.joggee.com

sorry for any inconvenience

Rana

Advertisements

10 thoughts on “SQL SERVER 2005- How to call nested stored procedure and save the output in Temporary Table

  1. Yes, you can create and insert values in temp table but using select query not stored procedure.

    i.e.

    Select * into #temp from Table

    You can also insert the values into temp table from Stored Procedure but Temp table should created before.

    i.e.
    Insert into #tempCityEmp Exec sp_First

    Hope this is your answer.

    If not please eloborate in detail what exactly you are asking and what is the benefit to do this in one line and why ?

    Thank you very much for your comments.

    regards,

    Rana

  2. you did not give proper syntax
    actually i want to save the data retrived from [sp_help table_name] in to a temporary table pls reply me fast

  3. create @temp_table table (all fields)
    Insert into @temp_table
    EXECUTE Sp_Travel_RaReturn_Table @detail,’|’,’,’

    here
    Sp_Travel_RaReturn_Table is storeprocedure for returning values in table format.
    Upper statement is not working in my store procedure. Even same statement is working in another storeprocedure.. All details are same in both storeprodecure
    –Chetan Patel

  4. Select * into #temp from Table

    will avobe works in sql server? I have little doubt on it. If so please let me know will help me a lot.

    thanks
    Deb

  5. Declare @GroupTable table
    (
    GroupId int ,
    GroupName nvarchar(50),
    DebitCon int,
    ClosingBalance decimal(18,2)
    )

    Insert Into @GroupTable Exec Acc_ProfitAndLossDemoversion 1,219,@FromDate ,@Todate,1,@FinacialYear,1,Null,Null,Null
    Insert Into @GroupTable Exec Acc_ProfitAndLossDemoversion 1,219,@FromDate ,@Todate,1,@FinacialYear,2,Null,Null,Null

  6. Greetings! This is my 1st comment here so I just wanted
    to give a quick shout out and say I really enjoy reading through your articles.
    Can you recommend any other blogs/websites/forums
    that go over the same subjects? Thank you so much!

  7. Hmm it looks like your blog ate my first comment (it was super long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying
    your blog. I too am an aspiring blog writer but I’m still new to everything. Do you have any recommendations for novice blog writers? I’d really appreciate it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s