diff --git a/extensions/mssql/src/objectManagement/ui/serverPropertiesDialog.ts b/extensions/mssql/src/objectManagement/ui/serverPropertiesDialog.ts index 1bb091e107b6..74ace5b5c6ce 100644 --- a/extensions/mssql/src/objectManagement/ui/serverPropertiesDialog.ts +++ b/extensions/mssql/src/objectManagement/ui/serverPropertiesDialog.ts @@ -369,37 +369,46 @@ export class ServerPropertiesDialog extends ObjectManagementDialogBase { this.objectInfo.autoProcessorAffinityMaskForAll = newValue; - for (let table of nodeTableList) { - let newData = table.data; - for (let i = 0; i < newData.length; i++) { - if (newValue) { - // if affinity mask for all is checked, then uncheck the individual processors - newData[i][AffinityType.ProcessorAffinity] = false; + if (isEnabled) { + for (let table of nodeTableList) { + let newData = table.data; + for (let i = 0; i < newData.length; i++) { + if (newValue) { + // if affinity mask for all is checked, then uncheck the individual processors + newData[i][AffinityType.ProcessorAffinity] = false; + } } + await this.setTableData(table, newData); } - await this.setTableData(table, newData); } + }, this.objectInfo.autoProcessorAffinityMaskForAll, isEnabled); this.autoSetProcessorIOAffinityMaskForAllCheckbox = this.createCheckbox(localizedConstants.autoSetProcessorAffinityIOMaskForAllText, async (newValue) => { this.objectInfo.autoProcessorAffinityIOMaskForAll = newValue; - for (let table of nodeTableList) { - let newData = table.data; - for (let i = 0; i < newData.length; i++) { - if (newValue) { - // if IO affinity mask for all is checked, then uncheck the individual processors - newData[i][AffinityType.IOAffinity] = false; + if (isEnabled) { + for (let table of nodeTableList) { + let newData = table.data; + for (let i = 0; i < newData.length; i++) { + if (newValue) { + // if IO affinity mask for all is checked, then uncheck the individual processors + newData[i][AffinityType.IOAffinity] = false; + } } + await this.setTableData(table, newData); + this.resetNumaNodes(); } - await this.setTableData(table, newData); - this.resetNumaNodes(); } }, this.objectInfo.autoProcessorAffinityIOMaskForAll, isEnabled);