如何找到read-only filegroup
中的哪些索引?当我尝试REORDER
或REBUILD
时,我需要将其排除在外。
答案 0 :(得分:0)
我自己找到了:
IF EXISTS(SELECT i.name AS FileGroup FROM sys.filegroups d
JOIN sys.indexes i ON i.data_space_id = d.data_space_id
WHERE (d.is_read_only = 1) AND (i.name LIKE ' ... index name ... '))
PRINT 'Do NOT REBUILD! File-Gruop is READ-ONLY';