当前位置:首页 > 技术支持

SQLSERVR 重建索引

正航软件2年前 (2023-11-14)技术支持2538

Sql2000语法:

select 'DBCC DBREINDEX(' + object_name(id) + ','''')'

from sysindexes

where id in (select id from sysobjects where xtype='U') and indid in (0,1)


sql2005及以上版本语法:

select 'DBCC DBREINDEX(' + name + ','''')' from sys.tables where type_desc='USER_TABLE' order by name


发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。