Declare @cAppName Char(30) Set @cAppName = devtst095.wsc' Select Distinct iBatchID , cTPAID , cFileName , cSubmittedBy , tCreateDt , 'Complete w/POINT ' as cStatus Into #TTCompletePoint From AppBatchStd Where iDel = 0 and cAppName = @cAppName and cStatusDesc like 'End of Batch Processing (with POINT%' Order by iBatchID Desc Select Distinct iBatchID , cTPAID , cFileName , cSubmittedBy , tCreateDt , 'Complete' as cStatus Into #TTComplete From AppBatchStd Where iDel = 0 and cAppName = @cAppName and cStatusDesc like 'Processing Complete%' Order by iBatchID Desc Select Distinct iBatchID , cTPAID , cFileName , cSubmittedBy , tCreateDt , 'Failed' as cStatus Into #TTFailed From AppBatchStd Where iDel = 0 and cAppName = @cAppName and cStatusDesc like 'Processing failed%' Order by iBatchID Desc Select Distinct iBatchID , cTPAID , cFileName , cSubmittedBy , tCreateDt , 'In Process' as cStatus Into #TTInProc From AppBatchStd Where iDel = 0 and cAppName = @cAppName and cStatusDesc like 'Start of Processing%' and iBatchID Not In (Select iBatchID from AppBatchStd Where cStatusDesc Like 'Processing complete%') Order by iBatchID DescThanks.