Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

t-sql load values from stored procedure into a temp table Expand / Collapse
Author
Message
Posted Thursday, May 8, 2014 3:24 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 9:00 PM
Points: 374, Visits: 440
I would like to know if the following sql can be used to obtain specific columns from calling a stored procedure with parameters:


/* Create TempTable */
CREATE TABLE #tempTable (MyDate SMALLDATETIME, IntValue INT)
GO
/* Run SP and Insert Value in TempTable */
INSERT INTO #tempTable (MyDate, IntValue)
EXEC TestSP @parm1, @parm2




If the above does not work or there is a better way to accomplish this goal, please let me know how to change the sql?
Post #1569096
Posted Thursday, May 8, 2014 3:38 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 1:45 PM
Points: 37,104, Visits: 31,659
wendy elizabeth (5/8/2014)
I would like to know if the following sql can be used to obtain specific columns from calling a stored procedure with parameters:


/* Create TempTable */
CREATE TABLE #tempTable (MyDate SMALLDATETIME, IntValue INT)
GO
/* Run SP and Insert Value in TempTable */
INSERT INTO #tempTable (MyDate, IntValue)
EXEC TestSP @parm1, @parm2




If the above does not work or there is a better way to accomplish this goal, please let me know how to change the sql?


Gosh... instead of waiting for an answer from a forum, just try it.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1569098
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse