Last active
January 9, 2022 19:03
-
-
Save mazzy-ax/b43def334881585853786422ca158787 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- удаляет определение элемента из нижних слоев (ближе к 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