David Smith

David Smith

  • NA
  • 2k
  • 0

Sql Stored Procedure

Dec 9 2015 1:33 AM
Can someone help me consolidate this procedure into robust way. The procedure is working. I want to rewrite to make it readable for other developers.
 
Select EmployeeNumber, Hours, PTO, StartDate, EndDate, PreviousHours
INTO #FinalPayPeriodTable
From #TempAggregatedTable
Select EmployeeNumber, ((Hours - (Hours - 80)) - PreviousHours - PTO) AdjHours, Hours as OrgHours, PTO, StartDate, EndDate, PreviousHours
From #FinalPayPeriodTable
Set @hours = (Select ((Hours - (Hours - 80)) - PreviousHours - PTO) AdjHours From #FinalPayPeriodTable)
RETURN @hours
 

Answers (13)