Insert Result Into Hash/Temp Table- Sql Server

Jul 22, 2019 BY xtreme
Insert Result Of Another Store Procedure
   CREATE TABLE #Result
   (
	   Status nvarchar(100),	
	   Id INT,	
	   Name nvarchar(200)
   )
   INSERT INTO #Result
   EXEC dbo.rpt_get_result @id,@filter	 


Insert Result of Dynamic Query

   CREATE TABLE #Result
   (
	   Status nvarchar(100),	
	   Id INT,	
	   Name nvarchar(200)
   )
   SET @SQL= 'SELECT Status, Id, Name From Students';
   INSERT INTO #Result
   EXEC(@SQL)	

Related