























与上一篇《SQL Server数据库所有表重建索引》相似,这一段存储过程只是更改了一条语句“DBCC showcontig(@name)” ,用来显示每个数据表的索引性能信息,方便评估当前数据库的整体性能。
USE My_Database;
DECLARE @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 DBCC showcontig(@name)
FETCH NEXT FROM authors_cursor
INTO @name
END deallocate authors_cursor
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。