updateXLedgerTransactionHeaderset XLedgerTransactionHoldStatusFid= caseItems.OnHold when1then@onHoldStatus else@offHoldStatus end from@itemsItems innerjoinXLedgerTransactionHoldSubmissionon Items.XLedgerTransactionHoldSubmissionId=XLedgerTransactionHoldSubmission.XLedgerTransactionHoldSubmissionId whereXLedgerTransactionHeader.XLedgerTransactionHeaderId=XLedgerTransactionHoldSubmission.XLedgerTransactionHeaderFid
declare@nowdatetimeoffset=sysdatetimeoffset()
updateXLedgerTransactionHoldSubmissionsetCompletedOn=@now from@itemsItems whereXLedgerTransactionHoldSubmission.XLedgerTransactionHoldSubmissionId=Items.XLedgerTransactionHoldSubmissionId end GO GRANTEXECUTEON[dbo].[XLedgerChangeTransactionHoldStatuses]TO[MssExec] GO