4
Reply

Insert result set of sp into a temp table

Ajay Mavatkar

Ajay Mavatkar

Jul 27 2017 2:32 AM
245
Hi,
 
I need to insert result set of SP into a  temp table, however it is giving the following error.
 
'The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction'
 
Please find my effort regarding this.
 
DECLARE @tempTable TABLE(ID INT, [Description] NVARCHAR(50));
INSERT @tempTable EXEC sp_MyTable] 100
select * from @tempTable
 
Any help would be apprciated. 
 

Answers (4)