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?
Assuming the output of Generate_Insert is a varchar(max)
you can do this inside Inserts: