
[dbo].[XLedgerImportAccountingPeriodRange]
create procedure [dbo].[XLedgerImportAccountingPeriodRange]
@fromDate date,
@toDate date
as
begin
set nocount on
;with Items as
(
select
Id = 1,
FromDate = @fromDate,
ToDate = @toDate
)
merge XLedgerAccountingPeriodRange with (tablock)
using Items on Items.Id = XLedgerAccountingPeriodRange.XLedgerAccountingPeriodRangeId
when not matched then
insert(
[XLedgerAccountingPeriodRangeId],
[FromDate],
[ToDate]
)
values(
Items.Id,
Items.FromDate,
Items.ToDate
)
when matched then
update set
[FromDate] = Items.FromDate,
[ToDate] = Items.ToDate
;
end
GO
GRANT EXECUTE ON [dbo].[XLedgerImportAccountingPeriodRange] TO [MssExec]
GO