September 29, 2011 at 7:49 pm
I would really appreciate any direction on how to accomplish the following in a stored procedure.
General idea:
1) create a #tmpTable CREATE #tmpTbl1 ( [fld defs] ...
2) insert into that new #tmpTbl1 a row of values returned by executing a separate stored procedure - like
INSERT
INTO
#tmpTbl1 (val1, val2, val3, val4 )
SELECT
val1, val2, val3, val4
FROM
( EXEC SP2 @param1=123 )
3) insert another record into that new #tmpTbl1 by calling the same SP with different param(s):
INSERT
INTO
#tmpTbl1 (val1, val2, val3, val4 )
SELECT
val1, val2, val3, val4
FROM
( EXEC SP2 @param1=456 )
Any and all guidance is appreciated!
September 30, 2011 at 1:51 am
This should do:
--2) insert into that new #tmpTbl1 a row of values returned by executing a separate stored procedure
INSERT #tmpTbl1 (val1, val2, val3, val4 )
EXEC SP2 @param1=123
--3) insert another record into that new #tmpTbl1 by calling the same SP with different param(s):
INSERT #tmpTbl1 (val1, val2, val3, val4 )
EXEC SP2 @param1=456
-- Gianluca Sartori
September 30, 2011 at 2:20 pm
It DID do!
Of all the combinations I tried, failed to come up with that one.
Sincerest thanks!
October 1, 2011 at 2:55 am
You're welcome.
Glad I could help.
-- Gianluca Sartori
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply