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