Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6648883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:42:29+00:00 2026-05-26T00:42:29+00:00

I have a stored Procedure (Generate_Insert)which will output an Insert statement as output given

  • 0

I have a stored Procedure (Generate_Insert)which will output an Insert statement as output given a table name.

But Now I have created another procedure which looks like:

Create Procedure Inserts
As
Begin

EXEC Generate_Insert @Table = 'Admin'

EXEC Generate_Insert @Table = 'Impas'

EXEC Generate_Insert @Table = 'Asui'

EXEC Generate_Insert @Table = 'Alstd'

END

The sample output of

EXEC Generate_Insert @Table = 'Admin' is:

Insert into Admin(Ad_ID,Name,Desc) Values (1,'John','Employee')

The problem is when I execute this procedure I am getting result sets in different windows but i want the output as one result set.

How can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:42:30+00:00Added an answer on May 26, 2026 at 12:42 am

    Assuming the output of Generate_Insert is a varchar(max)

    you can do this inside Inserts:

    create table #temp
    (
    insert_stmt varchar(max)
    )
    
    insert into #temp 
    EXEC Generate_Insert @Table = 'Admin'
    insert into #temp 
    EXEC Generate_Insert @Table = 'Impas'
    insert into #temp 
    EXEC Generate_Insert @Table = 'Asui'
    insert into #temp 
    EXEC Generate_Insert @Table = 'Alstd'
    
    select * from #temp
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Stored procedure, in which I have to insert 3 strings into
I currently have a stored procedure in which I want to insert new rows
I have a Stored procedure which schedules a job. This Job takes a lot
I have a stored procedure that inserts into a table (where there is an
I have a stored procedure that has a bunch of input and output parameters
Background I'm writing a web application and I have a stored procedure which inserts
I have stored procedure: ALTER PROCEDURE [dbo].[k_ShoppingCart_DELETE] @cartGUID nvarchar AS DELETE FROM [dbo].[k_ShoppingCart] WHERE
I have a strange, sporadic issue. I have stored procedure that returns back 5
I have a stored procedure in SQL 2005. The Stored Procedure is actually creating
I have a stored procedure that consists of a single select query used to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.