# AppSourceCop Error AS0042
Table key property changes that cause destructive changes must not be removed
## Description
Table key property changes that cause destructive changes must not be removed.
## Remarks
This error occurs when an attempt is made to remove table key properties that have already been published and are considered destructive. Destructive changes can lead to data loss, corruption, or other issues that can break the upgrade process for existing installations and dependent extensions.
## How to fix this diagnostic?
To resolve this error, you need to avoid removing published table key properties that are considered destructive. Here are the steps:
1. Locate the table key property in your code that is being removed.
2. Restore the property to its original state.
## Related information
AppSourceCop Analyzer<appsourcecop>
Get Started with AL<../devenv-get-started>
Developing Extensions<../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/analyzers/appsourcecop-as0042, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0042/
