13
Answers

Sql Stored Procedure

David Smith

David Smith

8y
533
1
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)