ALTERProcedure[dbo].[prClearLeaseShedule] -- Set value of Lease of all equipment associated with expired Lease Schedule to 0 -- Set total amount of Lease Schedule to 0. @intLeaseScheduleIdint As begintransaction -- Set value of Lease of all equipment associated with expired Lease Schedule to 0 update Inventory set Lease =0 where LeaseScheduleId =@intLeaseScheduleId if@@Error<>0goto PROBLEM -- Set total amount of Lease Schedule to 0 update LeaseSchedule Set PeriodicTotalAmount =0 where ScheduleId =@intLeaseScheduleId if@@Error<>0goto PROBLEM committransaction return0 PROBLEM: print'Unable to eliminate lease amounts from the database!' rollbacktransaction return1
ALTER Procedure [dbo].[prClearLeaseShedule]-- Set value of Lease of all equipment associated with expired Lease Schedule to 0-- Set total amount of Lease Schedule to 0. @intLeaseScheduleId intAs