与上一篇《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

相关文章:

  • 2022-01-19
  • 2021-08-06
  • 2021-12-15
  • 2022-12-23
  • 2021-09-27
  • 2022-12-23
  • 2022-01-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-23
  • 2022-02-03
  • 2022-12-23
  • 2021-08-17
相关资源
相似解决方案