Ramco Ramco

Ramco Ramco

  • 440
  • 3.4k
  • 529.6k

Data in Temp Table

Apr 27 2023 9:37 AM

Hi

I have below query & i want to insert data into temp table

ALTER PROC [dbo].[USP_Test]
as 
begin
SELECT SP.[ID]
      ,SP.[BookID]
	  ,B.[BookTitle]
	  
  FROM [SessionBookPlanningHistoricalData] SP
  JOIN [BookDetails] B
  ON SP.BookID=B.[ID]
  JOIN [StudentDetails] ST
  ON SP.[StudentID]=ST.[LoginCode]
  WHERE SP.[Deleted]=0 

UNION ALL

SELECT T0.[ID]
      ,T0.[BookID]
	  ,T0.[BookTitle]
	  
	FROM [SessionBookPlanningDetailed] T0
	WHERE T0.[HistoricalDataCount]=0 
End

Thanks


Answers (1)