我使用 SQL Server 2008 R2,我需要为数据库中的每个表重建索引
使用这个脚本,我收到一个错误
USE myDb
GO
EXEC sp_MSForEachTable 'ALTER INDEX ALL ON ? REBUILD'
错误:
ALTER INDEX failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.
知道如何修复它吗?谢谢
最佳答案
SQL Fool (Michelle Ufford) 有一个很棒的脚本可以为您执行此操作 - 所有这些都已完成并经过许多用户的良好测试。
这是一项伟大的工作 - 它允许您定义碎片级别
不要重新发明轮子 - just go see and use the script!
关于sql - 如何更改数据库中每个表的索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8326595/