diff --git a/AzureSQLMaintenance.txt b/AzureSQLMaintenance.txt index 14487ac..abe9f5f 100644 --- a/AzureSQLMaintenance.txt +++ b/AzureSQLMaintenance.txt @@ -243,7 +243,8 @@ begin and (alloc_unit_type_desc = 'IN_ROW_DATA' /*avoid LOB_DATA or ROW_OVERFLOW_DATA*/ or alloc_unit_type_desc is null /*for ColumnStore indexes*/) and OBJECT_SCHEMA_NAME(idxs.object_id) != 'sys' and idxs.is_disabled=0 - and obj.type_desc != 'TF' /* Ignore table value functions */ + and obj.type <> 'TF' /* Ignore table value functions */ + and not exists ( select * from sys.external_tables as et where et.object_id = obj.object_id ) order by i.avg_fragmentation_in_percent desc, i.page_count desc -- mark indexes XML,spatial and columnstore not to run online update