greek, noun, pron. "archarios" - beginner, learner, neophyte, novice
Suppose that you need to populate record set from a stored procedure. This is how it's being done:
CREATE PROC NameList
AS
SET NOCOUNT ON
SELECT Emp_FNAME, Emp_LNAME
From Emp_Table
SELECT FName, LName
From Table_of_Names
RETURN
When you execute this Stored Proc, it gives you something like this:
--First Set
Emp_FNAME Emp_LNAME
---------- -------------
John Doe
Jane Ramos
--Second Set
FName LName
---------- -----------
Jack Daniels
Juan Cruz
Suppose you have this Table structure [Target]:
CREATE TABLE dbo.MyNameTable
(First_Name VARCHAR (55),
Last_Name VARCHAR (55) )
You can insert the record set from the stored proc to the target table dbo.MyNameTable like this:
INSERT dbo.MyNameTable (First_Name, LastName)
EXEC NameList
Hope this helps.