A new Flexera Community experience is coming on November 25th. Click here for more information.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Updated ReIndexAll.sql script

The ReIndexAll.sql script uses the DBCC DBREINDEX command, which was deprecated over ten years ago.  Does anyone have a version of the script that uses ALTER INDEX instead?  

(2) Replies
ChrisG
By Community Manager Community Manager
Community Manager

I haven't seen anybody write a version of the script using ALTER INDEX. If you do one, it would be great to share it here!

FWIW, DBCC DBREINDEX is still fully supported by all current versions of SQL Server. The page at https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-dbreindex-transact-sql?view=sql-server-ver16 indicates this feature will be removed in a future SQL Server release. So if that does happen then the ReIndexAll.sql script would need to be updated when support for that SQL Server release is added to FlexNet Manager Suite.

(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)

We are using a slightly adjusted version of example D from following documentation:

sys.dm_db_index_physical_stats (Transact-SQL) - SQL Server | Microsoft Docs