Skip to content

Instantly share code, notes, and snippets.

@mazzy-ax
Last active January 9, 2022 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mazzy-ax/b43def334881585853786422ca158787 to your computer and use it in GitHub Desktop.
Save mazzy-ax/b43def334881585853786422ca158787 to your computer and use it in GitHub Desktop.
-- удаляет определение элемента из нижних слоев (ближе к sys),
-- если есть определение этого объекта в слое выше (ближе к usr).
-- после выполнения нельзя будет сравнить слои, поскольку определение останется только в одном слоев.
-- после выполнения этого скрипта выполните реорганизацию базы в MS SQL - model-база существенно уменьшится.
-- Только для тестирования и изучения Аксапты! Не используйте на ПРОДе.
delete from [ModelElementData] -- SELECT TOP (1000) *
where LayerId < 14 -- USR layer
and exists (
select top 1 * from [ModelElements] -- view ModelElement+ModelElementData
where [ModelElements].ElementType not in (117, 118) -- Label and Label files
and [ModelElements].ElementHandle = [ModelElementData].ElementHandle
and [ModelElements].LayerId > [ModelElementData].LayerId
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment