
[dbo].[XLedgerImportCompanies]
CREATE PROCEDURE [dbo].[XLedgerImportCompanies]
@items XLedgerCompanyImportItems readonly
AS
begin
set nocount on
;with MergeData as (
select Item.[XLedgerDbId], Item.[Name]
from @items Item
) merge XLedgerCompany with (tablock) using MergeData on
XLedgerCompany.[XLedgerDbId] = MergeData.[XLedgerDbId]
when matched then update set [Name] = MergeData.[Name]
when not matched then insert([XLedgerDbId], [Name]) values(MergeData.[XLedgerDbId], MergeData.[Name])
;
end
GO
GRANT EXECUTE ON [dbo].[XLedgerImportCompanies] TO [MssExec]
GO