delete from [IES].[T_POSTPONED_DELETE_ENTITY]
GO

INSERT INTO [IES].[T_POSTPONED_DELETE_ENTITY]
SELECT NEWID(), Entityes.Name, Entityes.ParentTriggerPaths
FROM    
(VALUES 
('IES.SCHET', '{.};{SchetMain}'),
('IES.SCHET_FILE', '{Schet};{Schet / SchetMain}'),
('IES.SCHET_SLUCH', '{SchetZap / Schet};{SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_ACCOMPLISHED', '{SchetZap / Schet};{SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_SANK', '{SchetSluch / SchetZap / Schet};{SchetSluchAccomplished / SchetZap / Schet};{SchetSluch / SchetZap / Schet / SchetMain};{SchetSluchAccomplished / SchetZap / Schet / SchetMain}'),
('IES.SCHET_USL', '{SchetSluch / SchetZap / Schet};{SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_ZAP', '{Schet};{Schet / SchetMain}'),
('IES.SCHET_ACT', '{Schet};{Schet / SchetMain}'),
('IES.SCHET_ACT_ITEM', '{SchetSluchAccomplished / SchetZap / Schet};{SchetSluchAccomplished / SchetZap / Schet / SchetMain}'),
('IES.ACT_ITEM_ERROR', '{SchetActItem / SchetSluchAccomplished / SchetZap / Schet};{SchetActItem / SchetSluchAccomplished / SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_ONK', '{SchetSluch / SchetZap / Schet};{SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_ONK_DIAG', '{SchetSluchOnk / SchetSluch / SchetZap / Schet};{SchetSluchOnk / SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_ONK_PROT', '{SchetSluchOnk / SchetSluch / SchetZap / Schet};{SchetSluchOnk / SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_USL_NAPR', '{SchetSluch / SchetZap / Schet};{SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_USL_ONK', '{SchetSluchOnk / SchetSluch / SchetZap / Schet};{SchetSluchOnk / SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_NAZ', '{SchetSluch / SchetZap / Schet};{SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_LS', '{SchetSluch / SchetZap / Schet};{SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_DS', '{SchetSluch / SchetZap / Schet};{SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_CONS', '{SchetSluch / SchetZap / Schet};{SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.KSG', '{SchetSluch / SchetZap / Schet};{SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.KSLP', '{OmsSchetSluch / SchetZap / Schet};{Ksg / SchetSluch / SchetZap / Schet};{OmsSchetSluch / SchetZap / Schet / SchetMain};{Ksg / SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.KSG_CRIT', '{Ksg / SchetSluch / SchetZap / Schet};{Ksg / SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.KSG_CALC', '{SchetSluch / SchetZap / Schet};{SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.MR_USL_N', '{SchetUsl / SchetSluch / SchetZap / Schet};{SchetUsl / SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_LEK_PR', '{SchetSluch / SchetZap / Schet};{SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_SANK_EXP', '{SchetSluchSank / SchetSluch / SchetZap / Schet};{SchetSluchSank / SchetSluchAccomplished / SchetZap / Schet};{SchetSluchSank / SchetSluch / SchetZap / Schet / SchetMain};{SchetSluchSank / SchetSluchAccomplished / SchetZap / Schet / SchetMain}'),
('IES.SCHET_USL_MED_DEV', '{SchetUsl / SchetSluch / SchetZap / Schet};{SchetUsl / SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_USL_ONK_LEK_PR', '{SchetUslOnk / SchetSluchOnk / SchetSluch / SchetZap / Schet};{SchetUslOnk / SchetSluchOnk / SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_USL_ONK_LEK_PR_DATE', '{SchetUslOnkLekPr / SchetUslOnk / SchetSluchOnk / SchetSluch / SchetZap / Schet};{SchetUslOnkLekPr / SchetUslOnk / SchetSluchOnk / SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.TARIFF_KOEF_DATA', '{SchetUsl / SchetSluch / SchetZap / Schet};{SchetUsl / SchetSluch / SchetZap / Schet / SchetMain};{SchetSluch / SchetZap / Schet};{SchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_DEST', '{OmsSchetSluch / SchetZap / Schet};{OmsSchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_DEST_PK', '{OmsSchetSluch / SchetZap / Schet};{OmsSchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_DEST_PROFILE', '{OmsSchetSluch / SchetZap / Schet};{OmsSchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_DEST_SP', '{OmsSchetSluch / SchetZap / Schet};{OmsSchetSluch / SchetZap / Schet / SchetMain}'),
('IES.SCHET_SLUCH_DEST_SUR', '{OmsSchetSluch / SchetZap / Schet};{OmsSchetSluch / SchetZap / Schet / SchetMain}'),
('IES.FRZL_MESSAGE_ZP', '{SchetZap / Schet};{SchetZap / Schet / SchetMain}'),
('IES.FRZL_RESPONSE_PARSE', '{FrzlMessage / As IES.FRZL_MESSAGE_ZP / SchetZap / Schet};{FrzlMessage / As IES.FRZL_MESSAGE_ZP / SchetZap / Schet / SchetMain}'),
('IES.FRZL_ERROR_ITEM', '{FrzlResponseParse / FrzlMessage / As IES.FRZL_MESSAGE_ZP / SchetZap / Schet}; {FrzlResponseParse / FrzlMessage / As IES.FRZL_MESSAGE_ZP / SchetZap / Schet / SchetMain}'),
('IES.FRZL_PERSON_DATA', '{FrzlResponseParseDatahistory / FrzlMessage / As IES.FRZL_MESSAGE_ZP / SchetZap / Schet}; {FrzlResponseParseDatahistory / FrzlMessage / As IES.FRZL_MESSAGE_ZP / SchetZap / Schet / SchetMain}'),
('IES.FRZL_POLICY_ITEM', '{FrzlResponseParseDatahistory / FrzlMessage / As IES.FRZL_MESSAGE_ZP / SchetZap / Schet}; {FrzlResponseParseDatahistory / FrzlMessage / As IES.FRZL_MESSAGE_ZP / SchetZap / Schet / SchetMain}'),
('IES.FRZL_DUDL_ITEM', '{FrzlResponseParseDatahistory / FrzlMessage / As IES.FRZL_MESSAGE_ZP / SchetZap / Schet}; {FrzlResponseParseDatahistory / FrzlMessage / As IES.FRZL_MESSAGE_ZP / SchetZap / Schet / SchetMain}'),
('IES.FRZL_ATTACH_ITEM', '{FrzlResponseParseDatahistory / FrzlMessage / As IES.FRZL_MESSAGE_ZP / SchetZap / Schet}; {FrzlResponseParseDatahistory / FrzlMessage / As IES.FRZL_MESSAGE_ZP / SchetZap / Schet / SchetMain}'),
('IES.FRZL_SNILS_ITEM', '{FrzlResponseParseDatahistory / FrzlMessage / As IES.FRZL_MESSAGE_ZP / SchetZap / Schet}; {FrzlResponseParseDatahistory / FrzlMessage / As IES.FRZL_MESSAGE_ZP / SchetZap / Schet / SchetMain}')
) AS Entityes (Name, ParentTriggerPaths)
WHERE NOT EXISTS (SELECT 1
                     FROM   [IES].[T_POSTPONED_DELETE_ENTITY] AS PDE
                     WHERE  PDE.Name = Entityes.Name);
GO
