SqlServer 重建索引
时间:2021-07-01 10:21:17
帮助过:2人阅读
@Name varchar(
100)
DECLARE authors_cursor
CURSOR FOR
SELECT [Name] FROM SysObjects
WHERE xType
=‘U‘ ORDER BY ID
OPEN authors_cursor
FETCH NEXT FROM authors_cursor
INTO @Name
WHILE @@FETCH_STATUS = 0
BEGIN
/*--填充因子:90,建议60-90之间,100的查询性能最好,但插入数据后会导致索引页迁移会影响修改的性能.*/
DBCC DBREINDEX (
@name,
‘‘,
90)
FETCH NEXT FROM authors_cursor
INTO @Name
END
deallocate authors_curso
SqlServer 重建索引
标签: