Capture Exec SP result into TEMP table in SQL

Posted by Jeyjey under Sql Server on 1/14/2014 | Points: 10 | Views : 1324 | Status : [Member] | Replies : 1
Hi,

I want to capture the executed stored procedure result into temp table.

select #temp into Exec SP name ??????????????

Could you please suggest anyone

Regards,
JJ




Responses

Posted by: Learningtorise on: 1/14/2014 [Member] Starter | Points: 25

Up
0
Down
You can't Do as Above.

Do it as Follows:
--Create Temporary Table For Example Mail Table

CREATE TABLE #Mails (
[Subject] VARCHAR(1000),
Body VARCHAR(8000),
SentBy VARCHAR(100),
SendTo VARCHAR(1000),
CC VARCHAR(2000),
BCC VARCHAR(2000)
)

INSERT INTO #Mails ([Subject], Body, SentBy, SendTo, CC, BCC)
EXEC [dbo].GetMailsByTcket @MyTicketNo


http://hashtagakash.wordpress.com/

Jeyjey, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response