Posts Insert results of stored procedure into a temporary table
Post
Cancel

Insert results of stored procedure into a temporary table

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- insert results of stored procedure into a temporary table

DECLARE	@return_value int
declare @temp table(DeliveryDate DateTime, OptionDateTime varchar(10))
insert into @temp
EXEC dbo.RR_GetDebtAdjMaturityDate 91706, '2011-10-31'

select * from @temp



-- Another example

DECLARE @People TABLE
(
    ContactID INT,
    FirstName NVARCHAR(50),
    LastName NVARCHAR(50)
)

INSERT @People (ContactID, FirstName, LastName)
EXEC dbo.GetPeopleByLastName @LastName = 'Alexander'
This post is licensed under CC BY 4.0 by the author.