Rupesh Kahane

Rupesh Kahane

  • 121
  • 18.5k
  • 3m

Insert into table variable from SP in SQL

Mar 3 2020 12:50 AM
My store procedure returns / select 3 tables after execution.
 
How can I insert only 1st table in table variable in SQL?
 
The below code is I am using  
  1. declare @myTable as table  
  2. (  
  3.  A_Name nvarchar(128),  
  4.  A_Id nvarchar(128),  
  5.  A_Total varchar(128)  
  6.  --- more columns  
  7. )  
  8.   
  9. INSERT INTO @myTable  
  10. EXEC 'sp_helpdb' 'Param1'  
 Thanks in advance 

Answers (1)